| Catmandu::Exporter::Text(3pm) | User Contributed Perl Documentation | Catmandu::Exporter::Text(3pm) |
Catmandu::Exporter::Text - a Text exporter
# From the command line
# Write all field values as a line of Text
$ catmandu convert JSON to Text --field_sep "," < data.json
# In a Perl script
use Catmandu;
# Print to STDOUT
my $exporter = Catmandu->exporter('Text', fix => 'myfix.txt');
# Print to file or IO::Handle
my $exporter = Catmandu->exporter('Text', file => '/tmp/out.yml');
my $exporter = Catmandu->exporter('Text', file => $fh);
$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 raw text. All field values found in the data will be contactenated using "field_sep" as delimiter.
Catmandu::Exporter , Catmandu::Importer::Text
| 2023-03-03 | perl v5.36.0 |