terminal-window viewer for tab-delimited files in *nix?
- by khedron
I work with a lot of tab-delimited data files, with varying columns of uncertain length.
Typically, the way people view these files is to bring them down from the server to their Windows or Mac machine, and then open them up in Excel. This is certainly fully-featured, allowing filtering and other nice options. But sometimes, you just want to look at something quickly on the command line.
I wrote a bare-bones utility to display the first<n>lines of a file like so:
--- line 1 ---
1:{header-1} 2:{header-2} 3:...
--- line 2 ---
1:{data-1} 2:{data-2} 3:...
This is, obviously, very lame, but it's enough to pipe through grep, or figure out which header columns to use "cut -f" on.
Is there a *nix-based viewer for a terminal session which will display rows and columns of a tab-delimited file and let you move the viewing window over the file, or otherwise look at data?
I don't want to write this myself; instead, I'd just make a reformatter which would replace tabs with spaces for padding so I could open the file up in emacs and see aligned columns. But if there's already a tool out there to do something like this, that'd be great!
(Or, I could just live with Excel.)