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

perl one liner for csv file one field

by MrTEE (Novice)
on Jan 17, 2015 at 04:55 UTC ( [id://1113573]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    
     for i in danny.csv danny1.csv
    ...
     #it would be nice to find a perl change the file in place
     sed -i '/D,642,0642,UBF,EVL,,M,,S,S,FOREVER,213,213,/d' /come/and/pla
    +y/with/us/danny.csv
     sed -i '/D,642,0642,UBF,EVL,,M,,S,S,QSP-U=C,4,4,/d' /come/and/play/wi
    +th/us/danny.csv
    
  2. or download this
     
    
     perl -p -i.bak -e 's/\,\w{7}\,//g - which does not work.
    
  3. or download this
     perl -nle 'print if /\,\w{7}\,/' /come/and/play/with/us/danny.csv
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1113573]
Approved by GrandFather
Front-paged by blindluke
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 02:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found