Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Text::CSV module, writing some data on a csv.by Lotus1 (Vicar) |
on Apr 06, 2016 at 15:43 UTC ( [id://1159731]=note: print w/replies, xml ) | Need Help?? |
If you aren't familiar with array references you might try using the style below instead. It uses the parse() and fields() functions to get an array of the columns for each line.
You could open an output file before the while loop, then after each line is parsed and @fields has values you can modify and print them to your new file. There is a nice page about CSV at Perl Maven and this Perlmonks node seems very similar to what you are trying to do. A Google search for tutorials for this module turns up lots more. Update: If you would like to modify existing csv files you might consider Tie::Array::CSV.
In Section
Seekers of Perl Wisdom
|
|