Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: File Find/Replace with the replacement coming from part of earlier matched string

by LanX (Chancellor)
on Feb 05, 2013 at 03:36 UTC ( #1017048=note: print w/replies, xml ) Need Help??


in reply to File Find/Replace with the replacement coming from part of earlier matched string

What did you try?

I would read line by line and try to match the headlines with a regex in an if statement.

if match headline then capture headline in variable else if empty line then print empty line else print captured headline + current line

hmm ... almost Python! :)

Cheers Rolf

  • Comment on Re: File Find/Replace with the replacement coming from part of earlier matched string
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1017048]
help
Chatterbox?
and a soft breeze sighs...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2016-12-08 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (135 votes). Check out past polls.