Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: how to insert new line in text file after regex match?

by Corion (Patriarch)
on May 21, 2015 at 10:54 UTC ( [id://1127335]=note: print w/replies, xml ) Need Help??


in reply to how to insert new line in text file after regex match?

This is simple - in your loop reading the lines, you remember when you see a line containing first. Then you count and output two more lines, and then output the additional line.

If you want to help us help you better, please show us the code you have already written and explain how it fails to do what you want it to do.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-26 00:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found