Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: i need to join two fields in .csv file??

by Tux (Abbot)
on Mar 14, 2013 at 08:45 UTC( #1023420=note: print w/replies, xml ) Need Help??


in reply to Re: i need to join two fields in .csv file??
in thread i need to join two fields in .csv file??

PLEASE advice using getline () instead of perl's internal getline:

open my $fh_in, "<", "test.csv" or die "test.csv: $!"; open my $fh_out, ">", "test_new.csv" or die "test_new.csv: $!"; my $csv_in = Text::CSV->new ({ binary => 1, auto_diag => 1 }); my $csv_out = Text::CSV->new ({ binary => 1, auto_diag => 1, eol => "\ +n" }); while (my $row = $csv_in->getline ($fh_in)) { $csv_out->print ($fh_out, [ @{$row}[2,1,0,3] ]); }

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1023420]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2016-08-30 08:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (414 votes). Check out past polls.