Skip to main content

See below my Workspace to generate a CSV file from a SQL View:

Forum1The CSV looks good except I need to put double quotes (“ “) for certain text strings. For example under Ledger Type column, AA should be ‘AA’.

Forum2Please let me know which of the String Function(s) in AttributeManager I should use to put double quotes around text strings (or other Transformer you deem more efficient):

Forum3Also, how can I replace all the comma separators in the CSV file with pipes character ’|’ instead.

Many thanks!

@fmesafejde​ There isn't a string function to add quotes. Just use the text editor to add the quotes:

"@Value(Ledger Type)"

You can set the delimiter on the CSV writer parameters when you add the writer to your workspace: Delimiter Character: |


Worked like a charm @Mark Stoakes​ 

One thing though.. somehow the CSV file format adds additional 2 more pair of double quotes to the text string even though i only defined as one pair of double quotes:

Forum5Forum4Believe it is more of a CSV file issue. Is there any workaround to only show one single pair of double quotes?


Worked like a charm @Mark Stoakes​ 

One thing though.. somehow the CSV file format adds additional 2 more pair of double quotes to the text string even though i only defined as one pair of double quotes:

Forum5Forum4Believe it is more of a CSV file issue. Is there any workaround to only show one single pair of double quotes?

I suspect you've got qualify field values set to "As needed", values with quotes will then get additional quotes added.

If you change this value to "No" you won't get the additional quotes

image


@ebygomm​  Thank you that worked!


Reply