Catmandu::Exporter::TSV
a tab-delimited TSV exporter
- Provided by: libcatmandu-perl (Version: 1.1000-2)
- Report a bug
a tab-delimited TSV exporter
# From the command line
$ catmandu convert JSON to TSV --fields "id,title,year" < data.json
# In a Perl script
use Catmandu;
my $exporter = Catmandu->exporter(
'TSV',
fix => 'myfix.txt',
header => 1);
$exporter->fields("f1,f2,f3");
$exporter->fields([qw(f1 f2 f3)]);
$exporter->add_many($arrayref);
$exporter->add_many($iterator);
$exporter->add_many(sub { });
$exporter->add($hashref);
printf "exported %d items\n" , $exporter->count;
This "Catmandu::Exporter" exports items as rows with tab-separated values (TSV). A header line with field names will be included if option "header" is set. See Catmandu::TabularExporter on how to configure the field mapping and column names. Newlines and tabulator values in field values are escaped as "\n", "\r", and "\t".
See Catmandu::TabularExporter, Catmandu::Exporter, Catmandu::Addable, Catmandu::Fixable, Catmandu::Counter, and Catmandu::Logger for a full list of methods.
Catmandu::Importer::TSV