Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by LanX (Canon)
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2014-07-29 02:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls