Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 lurking in the Monastery: (13)
As of 2014-10-01 21:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (38 votes), past polls