janisdd / vscode-edit-csv

vs code extension to edit csv files with an excel like table ui
MIT License
211 stars 30 forks source link

Removes " in some of the fields #143

Closed grayback90 closed 6 months ago

grayback90 commented 6 months ago

Hi,

We have csv (semicolon) file. Some of our columns have content in "" with ; in it. Not all just some. If I change an column in this file (any other than this specific column) and save the file he removes the "" and because the content has some ; in it, it will make them to new columns and this destroys the whole file.

Is there maybe an option I am missing? Or is this an bug? Can you help me? I can give you an example csv file if you want.

Thank you.

grayback90 commented 6 months ago

https://pastebin.com/dRF7PEYU

janisdd commented 6 months ago

I just tested it with your example and it works for me as expected (inserts the "" again).

Have you changed any setting of the extension? And can you please provide a screenshot where the "read options" and "write options" are visible?

grayback90 commented 6 months ago

Sure there you have the Screenshot. csv-edit

I have change the "QuoteChar" and "EscapeChar" in the seetings. This seetings works for all my colleagues but not for me. If i set the "QuoteChar" it works for the Line with ";" but not the line where I have the Text in "" but no ";".

janisdd commented 6 months ago

Actually, I doubt that these settings will work for your colleagues...

Why don't you set both options to the default value "?

Your example contains no line with "", but no ";".

In general, the quotation marks are only set if they are needed. If they are not needed, they are removed. If this is the behavior you describe, it is "intentional".

There is one exception: if the cells in the first row are quoted, then all cells in the same column will be quoted.

grayback90 commented 6 months ago

Thank your for your fast answer. I just tested it.

But its funny that it work for my colleagues with the missing inputs for "write options". 🤔

But we will just ignore it.

Thank your for your help. 👍