tsv - general tsv file mangler
tsv [options] file(s)
--show Display column names -f --cut COL,COL,COL like cut(1) but uses column names --rotate Turn columsn to rows --matchup FILE Rotate, grabbing header from FILE --validate Discards rows that have wrong column count -n --head COUNT Only process COUNT lines --default VALUE Replace empty values with VALUE --grep COLS PATTERN Search for pattern in cols --select COLS CODE Eval code on cols, output if returns true --help Display man page
tsv is a collection of small tools for manipulating and reporting on TSV (tab separated values) files.
Displays a numbered list of the columns
Outputs a new TSV with just the named columns. Columns must be named; separate column names with comma ,.
,
Turn the columns into rows and the rows into columns.
Grab the first row from FILE and then rotate. Usually this is used when with grep:
grep stuff file.tsv | tsv --match file.tsv
Look for PATTERN in COLUMNS (comma separate list, names or numbers)
Evaluate CODE. Each column will be in the variable $colname. A true value from the code will cause the line to print. Do not use return: the code is inside a while loop, not a sub.
$colname
return
Only output rows that have the same number of columns as the header line.
Replace empty values with VALUE. This can be combined with --validate.
Only process COUNT lines of input. This can be combined with all the other options except --show.
This package may be used and redistributed under the terms of either the Artistic 2.0 or LGPL 2.1 license.
To install tsv, copy and paste the appropriate command in to your terminal.
cpanm
cpanm tsv
CPAN shell
perl -MCPAN -e shell install tsv
For more information on module installation, please visit the detailed CPAN module installation guide.