Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: perl one liner to search for a string, then search for a different string and append a new line

by bart (Canon)
on Dec 20, 2012 at 11:52 UTC ( [id://1009726]=note: print w/replies, xml ) Need Help??


in reply to perl one liner to search for a string, then search for a different string and append a new line

The cause that nothing is working is probably because you process the file line by line and the parts of the strings you are looking for are on different lines. You can slurp in the whole file by using the -0 command line switch with an octal value that does not represent an existing character, as per the docs.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-03-28 15:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found