4 ms·
I've wanted something like this for ages. In fact I wanted something much simpler: just the ability to pipe tabulated data from a script into something and disp
by globular-toast 5y ago
I've wanted something like this for ages. In fact I wanted something much simpler: just the ability to pipe tabulated data from a script into something and display it in tabular format. I wrote my own at some point but found too many quirks for it to be useful. Visidata can do what I need and much, much more. Awesome!
- darrenf 5y ago> just the ability to pipe tabulated data from a script into something and display it in tabular format Not 100% sure I understand your requirement, but does `column` fit the bill? $ echo -e "foo,bar,quux\n1,2,3" | column -t -s, foo bar quux 1 2 3
- ipdashc 5y ago`column` is nice, but fails on empty cells and cells with escapes or quotes
- globular-toast 5y agoYeah, `column | less -S` works fairly well but empty cells and escaping etc. turns up too often. It essentially means you need a proper CSV parser, which is non-trivial. The other common problem was long values making the output unreadable. Some kind of default truncation is essential.
- darrenf 5y agoI agree `column` is imperfect, but empty cells at least don't seem to be a problem. $ echo -e 'foo,bar,quux\n1,,3' | column -t -s, foo bar quux 1 3 The man page says: > Version 2.23 changed the -s option to be non-greedy Elsewhere on an ancient Ubuntu I have lying around, `-n` did the same: -n By default, the column command will merge multiple adjacent delimiters into a single delimiter when using the -t option; this option disables that behavior. This option is a Debian GNU/Linux extension.
- ajoseps 5y agoI think xsv is what you're looking for: https://github.com/BurntSushi/xsv https://github.com/BurntSushi/xsv. Specifically xsv table.
- Epa095 5y agoSounds like you might wanna take a look at https://github.com/pgdr/ph https://github.com/pgdr/ph $ cat iris.csv | ph columns setosa versicolor | ph head 15 | ph tail 5 | ph show setosa versicolor -- -------- ------------ 0 1.5 0.2 1 1.6 0.2 2 1.4 0.1 3 1.1 0.1 4 1.2 0.2