Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 perusing the Monastery: (5)
As of 2014-08-30 14:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls