Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Better method to cut columns from delimited file

by Tux (Abbot)
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://969810]
help
Chatterbox?
[Corion]: Also, a good application to test my API to rate limit things
[choroba]: Dangers of WFH: a mailman rings, brings a parcel for my wife, I need to go outside, take my son with me, sign a paper *and* into the postman's mobile app, get back. Guess what the soup was doing meanwhiles?

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2017-10-18 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (244 votes). Check out past polls.

    Notices?