Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Stripping a seemingly complicated comma-delimited file

by andreychek (Parson)
on Jun 11, 2001 at 18:00 UTC ( #87487=note: print w/replies, xml ) Need Help??


in reply to Stripping a seemingly complicated comma-delimited file

Well, if you enjoy that code you are writing, that is fine.. however, there is already a module that can do most of the dirty CSV work for you.

I went to dig around at CPAN to figure out what all was available, but apparently somebody tampered with it, so CPAN is down for now.

In the meantime, modules that may help you are Text::CSV_XS and, if you are interested in using SQL syntax, perhaps DBD::CSV might be neat.

One good reason to use one of these is that if you're data gets any more complicated then what you mentioned, you might have to use some regexes which are a bit more complex, and somebody already did that work for us :-)
-Eric

Update: Good golly, apparently I type too slow.. there were only 2 comments when I clicked on the comment button :-)
  • Comment on Re: Stripping a seemingly complicated comma-delimited file

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://87487]
help
Chatterbox?
[ambrus]: Today I accidentally cut my hand while carrying a computer. On the display part of the motherboard that sticks out at the back of the chasis and has ports, there's this thin metal sheet with holes cut for the ports, to guide plugs into the sockets.
[ambrus]: This sheet has sharp needle-like parts, 0.004 long and less than 0.001 wide, that can get bent to point outwards, and one of these cut into my palm when I lifted the box.
[ambrus]: So now when I choose what motherboard to buy for my new home computer, I have one more specific property to guide me. Useful, because there's so many different boards to choose from.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2017-01-16 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (151 votes). Check out past polls.