mechatroner / vscode_rainbow_csv

🌈Rainbow CSV - VS Code extension: Highlight CSV and TSV files in different rainbow colors to make them more readable
MIT License
426 stars 51 forks source link

This CSV Not Parsing #92

Closed Chiliyago closed 1 year ago

Chiliyago commented 3 years ago

The following two lines of CSV are not parsing correctly. Can someone check to see why? Thanks

image image

No.,Scan List Name,Scan Channel Member,Scan Channel Member RX Frequency,Scan Channel Member TX Frequency,Scan Mode,Priority Channel Select,Priority Channel 1,Priority Channel 1 RX Frequency,Priority Channel 1 TX Frequency,Priority Channel 2,Priority Channel 2 RX Frequency,Priority Channel 2 TX Frequency,Revert Channel,Look Back Time A[s],Look Back Time B[s],Dropout Delay Time[s],Dwell Time[s] 1,Orange VUHF,K6CF AnhmHlls|K6COV Orng|K6MWT LkFrstSntg|K6NBR NwprtBch|K6QEH FllrtnRyth|K6SOA LgnBch|K6SOA SnClmnt|K6SOA TrbcCnyn|K6SYU FllrtnSt.J|KA6EEK IrvnSgnlP|KE6FUZ AnhmDsnyl|N6ME Fllrtn|N6SLD LkFrstSntg|W6HBR OrngPlsnts|W6KRW SnClmnt|W6KRW TstnLmRdg|W6VLD HntngtnBch|WA6FV FntnVlly|WA6YNT Plcnt|WB6HRO CstMsCtyH,145.1400|145.1600|145.2200|145.2400|145.2600|145.4000|145.4200|146.0250|146.2650|146.7900|146.8950|146.8950|146.9400|146.9700|147.0600|147.4350|147.4650|147.6450|147.8550|147.9150,144.5400|144.5600|144.6200|144.6400|144.6600|144.8000|144.8200|146.6250|146.8650|146.1900|146.2950|146.2950|146.3400|146.3700|147.6600|146.4000|146.5050|147.0450|147.2550|147.3150,OFF,OFF,OFF,,,OFF,,,Selected,0.5,0.5,0.1,0.1

mechatroner commented 3 years ago

Thanks @Chiliyago your file actually shows a problem with the autodetection algorithm that Rainbow CSV uses. Basically, if the number of lines is less than the threshold (5) the autodetection algorithm switches from comparing the number of separators in each line to simple frequency-based separator selection. And since the pipe | character is more frequent in your file than the comma, Rainbow CSV assumes that you have a pipe-separated file. You can fix it by selecting the right file type or by selecting one of the commas -> right click -> set as rainbow separator.

I will see what I can do about improving the autodetection algorithm to make it smarter in cases like this.

Chiliyago commented 3 years ago

I tried the commas -> right click -> set as rainbow separator but it did not take hold for me. Does it work for you?

mechatroner commented 3 years ago

Does it show any error? It works for me. You need to select a single comma character as if you wanted to copy it with Ctrl+C.

Chiliyago commented 3 years ago

No error just nothing happens after selecting the comma. Still shows this even clicking it.
image

image

mechatroner commented 3 years ago

This is how it looks like, I selected a comma with the mouse cursor and made a right-click: image If it still doesn't work there is another option to change the filetype: in the bottom right corner click on the CSV (pipe) and select CSV (csv) from the menu. hope it helps!

Chiliyago commented 3 years ago

Yes indeed I am doing that.

On Thu, Jul 15, 2021 at 5:48 PM Dmitry Ignatovich @.***> wrote:

This is how it looks like, I selected a comma with the mouse cursor and made a right-click: [image: image] https://user-images.githubusercontent.com/5349737/125875176-780d629b-7bf3-46e2-8c36-1adf882eb4e0.png If it still doesn't work there is another option to change the filetype: in the bottom right corner click on the CSV (pipe) and select CSV (csv) from the menu. hope it helps!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mechatroner/vscode_rainbow_csv/issues/92#issuecomment-881098755, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA7HQI5FHXIHJRPOSCMT23TX56WDANCNFSM5AOJR6YQ .

--

Tim Odell

FCC call sign: K6TJO

mechatroner commented 3 years ago

That's really strange. The only explanation that comes to my mind is that maybe you have an old version of VSCode. But then it would probably not highlight it with "CSV (pipe)" in the first place. Could you please also try it with some random text in a new window? Just type some characters and commas and use one of them to set as a separator. Maybe it is something very wrong with this particular file? Or you can also try to restart your editor. Sometimes a conflict with another extension can cause a bug like this I guess.

mechatroner commented 3 years ago

BTW does explicit filetype change work for you? Through the VSCode built-in filetype selection menu.