View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
David Muir Sharnoff > tsv-0.3 > tsv


Annotate this POD

View/Report Bugs
Source   Latest Release: tsv-0.4


 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.

--matchup FILE

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)

--select CODE

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.


Only output rows that have the same number of columns as the header line.

--default VALUE

Replace empty values with VALUE. This can be combined with --validate.

-n --head COUNT

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.

syntax highlighting: