NAME
Text::CSV::Auto::ExportTo::CSV - Export a CSV to a CSV.
SYNOPSIS
use Text::CSV::Auto;
use Text::CSV::Auto::ExportTo::CSV;
my $auto = Text::CSV::Auto->new('path/to/file.csv');
my $exporter = Text::CSV::Auto::ExportTo::CSV->new(
auto => $auto,
file => 'path/to/new_file.csv',
);
$exporter->export();
DESCRIPTION
This module allows the exporting of a CSV to a new CSV.
ATTRIBUTES
auto
The Text::CSV::Auto instance to copy headers and rows from. Required.
file
The file name to write the new CSV to. Required.
csv_options
Set this to a hashref of extra options that you'd like to have passed down to the underlying Text::CSV writer.
Read the Text::CSV docs to see the many options that it supports.
csv
This contains an instance of the Text::CSV object that is used to write the CSV file. You may pass in your own writer object. If you don't then one will be instantiated for you with the csv_options().
If not set already in csv_options, the following defaults will be used:
auto_diag => 1 # die() if there are any errors.
sep_char => $auto->separator()
newline
The character used for newlines. Defaults to "\n" which will produce a newline that is the default for your OS.
METHODS
export
$exporter->export();
Exports the source CSV file to the destination CSV file.
AUTHOR
Aran Clary Deltac <bluefeet@gmail.com>
LICENSE
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.