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

[Align CSV Columns] trim whitespace #75

Closed lukepighetti closed 4 years ago

lukepighetti commented 4 years ago

If you have data with a bunch of whitespace at the top or bottom, or double blank lines, Align CSV Columns could (should?) trim the whitespace.

This is related to https://github.com/mechatroner/vscode_rainbow_csv/issues/74 which is about a general desire to enable TSV/CSV prettify/formatting with this extension.

mechatroner commented 4 years ago

Hi @lukepighetti ! What do you mean

a bunch of whitespace at the top or bottom

Could you please provide an example?

lukepighetti commented 4 years ago

this    is  a   tsv

with    a   bunch   of
whitespace  in  many    places

could be trimmed to

this    is  a   tsv
with    a   bunch   of
whitespace  in  many    places
mechatroner commented 4 years ago

Thank you! I don't want Align Columns to remove lines, this could be a very unexpected and sometimes even undesirable side-effect for users. I think that simple commands/tools like Align Columns should have one clear purpose that they fulfill. We could add a separate command like Remove Empty Lines (although there is nothing specific for CSV files in this operation), but actually, it is very easy to do using VSCode built-in functionality: https://stackoverflow.com/questions/36350324/visual-studio-code-delete-all-blank-lines-regex