Written by

Question Warren Grob · Sep 10, 2018

Issue with output file format

I am having an issue with the output file format on a production where quotes (" ") around column values are being removed from the imported file.  For example, my input file is a csv formatted as such: "123", " ", "ABC".  The output file format that is being generated produces: 123, , ABC.  I need the output file to retain the quotes around the data.

Is this something that can be corrected in the record map?  Or is it an issue elsewhere?

Comments

Robert Cemper · Sep 17, 2018

Assuming you create your Output by WRITE variable
the most simple solution would be to change it to   WRITE """"_variable_""""

if your variable can contain quotes that need to be escaped WRITE """"_$REPLACE(variable,"""","""""")_""""
may fit your needs.

More sophisticated you may hide the quoting in some macro definition.

0
Warren Grob  Sep 17, 2018 to Robert Cemper

The actual answer was much more simple.  In the Record Mapper, first I unchecked the "Quote Escaping" box.  Then once I realized I can have more than one character as a field separator (single comma), I used 'quote comma quote' (",") as my field separator.  Worked as needed. 

Thanks for your input!

0
Eduard Lebedyuk  Sep 17, 2018 to Warren Grob

Wouldn't it produce strings like this:

stringA","stringB","stringC

leaving strings A and C unquoted?

0