Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 exploiting the Monastery: (5)
As of 2015-08-05 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (79 votes), past polls