Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: CSV Manipulation

by furry_marmot (Pilgrim)
on Nov 16, 2011 at 19:17 UTC ( #938443=note: print w/replies, xml ) Need Help??

in reply to CSV Manipulation

If you're just processing each line separately, I would think the easiest way, especially for large files, would be
  1. open the first file
  2. open an output file
  3. then read a line from the first file,
  4. process the line, including converting to fields or editing the fields in place
  5. write the line to the new file.

If no errors, the new file contains all the processed data.

Text::CSV shows an example of testing a field in place right at the top of the perldoc. It's also the best tool for CSV files.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://938443]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2018-02-25 12:46 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (312 votes). Check out past polls.