3 ms·
TSV looks incredibly ugly when opened in a text editor unless all values are 7 characters or less.
by mort96 2y ago
TSV looks incredibly ugly when opened in a text editor unless all values are 7 characters or less.
- ciupicri 2y agoSet a bigger tab size in the editor, e.g. `:set ts=32` in vim.
- mort96 2y agoAaaand now I can fit like 3 fields next to each other before they wrap and the field with arbitrary length text still misaligns the field after it
- bee_rider 2y agoThere is at least a chance that the text fields will fit in a tab. If not, a tool like “column” on Linux can be used. There is no chance that a text field will fit inside the width of a comma.
- ciupicri 2y agoI was about to mention that column [1] is part of util-linux, so perhaps it's Linux specific, but then I noticed this in the FreeBSD man page [2]: > The column command appeared in 4.3BSD-Reno. [1]: https://man7.org/linux/man-pages/man1/column.1.html https://man7.org/linux/man-pages/man1/column.1.html [2]: https://man.freebsd.org/cgi/man.cgi?query=column&sektion=1 https://man.freebsd.org/cgi/man.cgi?query=column&sektion=1
- cgb_ 2y agovartabstop can help with per-column width. I found https://sharats.me/posts/automating-the-vim-workplace-3/#using-vartabstop-to-line-up https://sharats.me/posts/automating-the-vim-workplace-3/#usi... which greatly improved my TSV editing experience in vim. Couple that with autocmd TextChangedI and you get realtime recalculation and alignment.
- nayuki 2y agoThere are some specialized text editors for editing files with tabs. https://en.wikipedia.org/wiki/Tab_stop#Dynamic_tab_stops https://en.wikipedia.org/wiki/Tab_stop#Dynamic_tab_stops , https://nick-gravgaard.com/elastic-tabstops/ https://nick-gravgaard.com/elastic-tabstops/ , https://tibleiz.net/code-browser/ https://tibleiz.net/code-browser/
- deleted 2y ago[deleted]
- mort96 2y agoIf have to use a dedicated tabular data editing program, I may as well use a spreadsheet application. What do the options you propose do better than libreoffice calc?
- bee_rider 2y agocolumn -t | less -S is pretty nice because you can inspect a file or dataset on a server (no X) before downloading, to see if you even want to bother. Or you can pass it along through a series of pipes to just get the rows you want.
- mort96 2y agoWhat part of "the value of CSV is to have something that can be easily viewed and modified in any text editor" do you not understand
- bee_rider 2y agoI’m not sure where that quote is from but it is incorrect, CSVs aren’t easily viewed or modified in text editors in general (at least not in any way that takes advantage of their tabular nature). There’s at least a slight chance that tab separated values will look ok in a text editor (although in general, nope).
- solidsnack9000 2y agoHow does CSV look when the fields are all of different widths?
- mort96 2y agoLike a list of lists of strings
- pstuart 2y agomeh. The whitespace makes it easier to eyeball IMHO.