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

Answer: How do I delete/modify one line from test file ?

( #19445=categorized answer: print w/ replies, xml ) Need Help??

Q&A > files > How do I delete/modify one line from test file ? contributed by marcos

perl -ni.bak -e 'print unless /(b\|)*b/' filename
This line edit in place (-n option) filename removing any line like b|b|b|b, and save the original filename as filename.bak (-i.bak option).
I'm not sure this is what you need, but I hope it helps
marcos

Comment on Answer: How do I delete/modify one line from test file ?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2015-07-07 10:10 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 (88 votes), past polls