CSV Writer: Writing a string with a semicolon ; inside

Hi guys,

I am struggeling with the CSV Writer when writing Strings which contain a semicolon inside.
The normal column delimiter is a semicolon as well, which i would prefer not to change.

This is how the KnimeTable/ the column looks before entering the CSV-Writer:
image

Which results in this CSV:
image

When using this settings:
image
image

Do you have any suggestions on how to solve this problem? Thank you!

1 Like

Hi @Bastian

We have all been through this problem at least once in our life of data science lol.

My two cents solutions to this problem are usually:

  • Chose another separator, such as “,”, tab or others, provided that they are not already used in your own data, and provided too that the users will be happy with your choice.
  • Add -Quote values- “If needed” or for “String only” as showed in the snapshot you have provided. It is checked as “Never” in your snapshot. Wouldn’t this be a solution for you :thinking: ?

B.t.w. looking twice to your initial table, I realize that your text already has strings with quotes in the “CHARG” column. Are they really need ? This is most probably annoying the -CVS writer- node when needing to code the file format of your file if -;- and -"- are present at the same time. Maybe this is the problem … I would remove them first from your data and then use the “String only” option to add them.

Hope this helps.

Best

Ael

6 Likes

Hi @aworker,

thank you that did help indeed.
I do need the String quotes earlier in the workflow, which does not stop me from removing them in the end.
Removing them and selecting “String only” did the work, thank you!

3 Likes

My pleasure @Bastian. Glad it worked and thanks for validating the answer.

Best wishes,

Ael

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.