vscode_rainbow_csv icon indicating copy to clipboard operation
vscode_rainbow_csv copied to clipboard

Add fallback to "simple" dialect for comma and semicolon -separated content autodetection

Open rufik opened this issue 11 months ago • 2 comments

I'm hitting an error Unable to align: Inconsistent double quotes at line 3 when double quotes are used inside field value, like that example:

ID;name;comment
12;first one;here goes the comment
13;lorem delenit;Lorem "ipsum dolor" sit amet
15;last one;In dolore nibh takimata sanctus amet

As you can see fields are not quoted. Quotes are used only inside the field string. And extension does report it as an error and refuses to align data :(

rufik avatar Jan 29 '25 13:01 rufik

I'm hitting this too. Any double quote will disable line alignment.

flaviotordini avatar Feb 05 '25 08:02 flaviotordini

Thank you for reporting this. It looks like the root cause is that Rainbow CSV is currently too prescriptive when it comes to comma and semicolon-separated files and doesn't try to autodetect non-standard dialects. If you just have one or two files like this you can "fix" it by manually switching the dialect to "simple" : select any semicolon character with cursor -> Right Click -> Set Rainbow Separator and then choose the "Literal" policy. I will try to figure out how to adjust the autodetection to handle such files automatically as I understand not every use case requires compliance with RFC 4180

mechatroner avatar Feb 11 '25 05:02 mechatroner