Catmandu::Exporter::CSV
a CSV exporter
- Provided by: libcatmandu-perl (Version: 0.9505-1)
- Report a bug
a CSV exporter
use Catmandu::Exporter::CSV;
my $exporter = Catmandu::Exporter::CSV->new(
fix => 'myfix.txt',
quote_char => '"',
sep_char => ',',
escape_char => '"' ,
always_quote => 1,
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 objects\n" , $exporter->count;
This "Catmandu::Exporter" exports items as rows with comma-separated values (CSV). Serialization is based on Text::CSV. A header line with field names will be included if option "header" is set. Field names can be read from the first item exported or set by option "fields". Newlines and tabulator values are in field values are escaped as "\n", "\r", and "\t".
See Catmandu::Exporter, Catmandu::Addable, Catmandu::Fixable, Catmandu::Counter, and Catmandu::Logger for a full list of methods.
Catmandu::Importer::CSV, Catmandu::Exporter::Table Catmandu::Exporter::XLS