colout
colout copied to clipboard
Is there a theme to color TSV (or CSV) output by column?
Thanks!
The question is ambiguous in many ways, but my wild guess is that it is easily feasible without needing a theme, for instance:
cat file.csv | colout --colormap "([^,]*),*" blue,yellow"
gives something like:
Is it what you want to achieve?
Thanks @nojhan ! It is very similar already!
The following screenshot is colored in vim with the plugin rainbow_csv. I wonder if it could be done with colout in output and/or if it is worth the effort to create an theme.
I did not succeed to find a vanilla way to do that, the best I came up with would be:
cat file.csv | colout -g $(for i in $(seq 1 7); do echo -n "([^,]*),*"; done) rainbow
(Which requires to know in advance the number of columns).
Now I'm thinking of what would be the best option to integrate that as a feature. So far I'm thinking of:
- Add an option to reset the colormap counting after each line.
- Put the random seed within this reset.
This would allow to use both rainbows and random colormaps in such a way.