eol => '\012'
eol => '\015'
eol => '\l'
eol => '\r'
####
#!/usr/bin/perl -w
use strict;
use diagnostics;
use Text::CSV;
my $qfn_in = 'data.csv';
open( my $fh_in, '<', $qfn_in )
or die("Can't open file \"$qfn_in\": $!\n");
my $fh_out = \*STDOUT;
my $csv_in =
Text::CSV_XS->new( { sep_char => ',', binary => 1, eol => '\015' } );
my $csv_out = Text::CSV_XS->new( { sep_char => "\t", eol => $/ } );
while ( my $row = $csv_in->getline($fh_in) ) {
$csv_out->print( $fh_out, [ @$row[ 2, 3, 0, 4 ], ] );
}
##
##
#!/usr/bin/perl -w
use strict;
use diagnostics;
use Text::ParseWords;
my $mydata = "data.csv";
open( FILE, "<$mydata" )
or die("Couldn't open CSV file $mydata:$!\\n");
my $line;
my @fields;
while ( $line = ) {
@fields = "ewords( ',', 0, $line )
or ( warn "a problem on line $.:$_" );
# Set variable values based on the array values.
my $id = $fields[0];
my $brand = $fields[1];
my $dbt = $fields[2];
my $cdt = $fields[3];
my $color = $fields[4];
my $number = $fields[5];
}
exit;