double quote in CSV

Home Page Forums BizTalk 2004 – BizTalk 2010 double quote in CSV

Viewing 1 reply thread
  • Author
    Posts
    • #15689

      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

    • #15690

      Figured it out.

      After defining Wrap character in every element, it's working.

       But if only define it in <Schema> node, won't generate wrap quotes.  

       

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.