Customer Portal

Surrounding data with double quotes for a CSV file

Comments 3

  • Avatar
    avackova
    0
    Comment actions Permalink
    Hello Pramod,
    I see two solutions of your problem:
    • Output metadata from Reformat node contains only string data field with quoted values

    • Use StructureWriter instead of Universal or Delinited Data Writer, with body mask like "$field1","$field2","$field3"....
  • Avatar
    pokemon
    0
    Comment actions Permalink
    Thanks Agata!
    I was able to fix my problem successfully with the StructureWriter.

    But I've just one clarification, do I need to explicitly specify a record delimiter (a new line in my case) while specifying the mask? or is there a way i can tell the StructureWriter to put a new line after every record it writes?

    Since I'm using it to write CSV files, I'm currently specifying the mask as
    "$field1","$field2",....,"$fieldn"\n
    to get it to write every record on a new line.

    Thanks,
    Pramod.
  • Avatar
    avackova
    0
    Comment actions Permalink
    Hello Pramod,
    you are right - the record delimiter must be specified in the mask. There is no other way to put in to the file. If you suppose that the graph can run on various systems use parameter for it:
    "$field1","$field2",....,"$fieldn"${rec_delimiter}

Please sign in to leave a comment.