Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 taking refuge in the Monastery: (2)
As of 2024-06-22 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.