Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Better method to cut columns from delimited file

by Tux (Monsignor)
on May 10, 2012 at 13:37 UTC ( #969810=note: print w/ replies, xml ) Need Help??


in reply to Better method to cut columns from delimited file

Spreadsheet::Read comes with xlscat, which can filter rows and/or columns from CSV, XLS and other spreadsheet like formats:

$ cat test.csv NAME|AGE|CITY|ZIP AAA|23|STAT|60001 BBB|34|PPOR|12345 CCC|11|TRET|2345 $ xlscat --in-sep-char=\| -C1,3 test.csv NAME|CITY AAA|STAT BBB|PPOR CCC|TRET $

For CSV-like formatted files, it uses Text::CSV_XS.


Enjoy, Have FUN! H.Merijn


Comment on Re: Better method to cut columns from delimited file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2015-07-03 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (53 votes), past polls