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?

  • 0
  • 1
  • 137
  • 2
  • 1

Respuestas

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.

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!

Wouldn't it produce strings like this:

stringA","stringB","stringC

leaving strings A and C unquoted?