Sublime-Text-Advanced-CSV icon indicating copy to clipboard operation
Sublime-Text-Advanced-CSV copied to clipboard

Skip comments

Open cbrown1 opened this issue 7 years ago • 2 comments

Hi, Nice plugin. I use csv files with comments at the top, and it would be great if those could be skipped when justifying the rows. Here is an example:

# This is a comment at the top of a csv file # There may be more than one comment line Header1,Header2,Header3 data1,data2,data3 data-a,data-b,data-c

cbrown1 avatar Apr 23 '18 14:04 cbrown1

I do this as well, but I also uses rows to include units and descriptions for nonobvious columns. If it didn't justify any comment, then those wouldn't get justified. I can't think of a straightforward way to sensibly choose whether to justify. Maybe only justify if the row contains delimiters?

# Data collected from blah blah.
#, , , Above ground yield.
#, , , kg / m^2
line_id, plot_id, year, yield
WT S NN, A, 2014, 0.439595491985597
WT S NN, B, 2014, 0.375006810619682

justinmcgrath avatar Mar 06 '19 16:03 justinmcgrath

I have seen this handled in other contexts (eg., numpy import) with a parameter to specify the comment character, and in which '#' is almost always the default. Any line that starts with any of the specified comment characters is skipped. The other way (looking for delimiters) often doesn't work because comments could contain that character.

cbrown1 avatar Mar 06 '19 16:03 cbrown1