I need to transform a pipe delimitered file into a CSV file.
0065878|TEST OF "COMMENTS", ""FIELD"" – fixed|03|TTRN2
The desired the CSV would be:
0065878,"TEST OF ""COMMENTS"", """"FIELD"""" – fixed",03,TTRN2
But the one i got is:
0065878,TEST OF "COMMENTS", ""FIELD"" – fixed,03,TTRN2
Then i used script in Map to generate doulbe quote to wrap the field:
Public Function WrapConvert(ByVal param1 As String) As String
param1=""""+param1+""""
WrapConvert= param1
End Function
But i don't know how to deal with the double quote containing in the string. For every double quote, there should be a double quote as the escape character before it. The only way i can think of is doing a replace in inbound map, whenever in pipe delimiter file, find a double quote charater, replace it with two doulbe quotes ("–>"")
Is there any easy way to tackle this, since this may happen to every element in a schema, i have to drop a script functoid for every element in map?
Cheers
Merry