Placing Text Elsewhere in html document

Tool for Search and Replace across multiple files.
Post Reply
Steve_L
Posts: 4
Joined: Sat May 25, 2013 12:59 am

Placing Text Elsewhere in html document

Post by Steve_L »

Ok...I am really having some trouble trying to figure this one out....hopefully someone will have an answer for me as I am still learning this.

I have some text between tags that I need to copy and place between another set of tags on another line.

Example:
I have text between an H1 tag on line 30 that I want to take and put between H2 tags on line 20 and eliminate the text that was previously between the H2 tags and then delete line 30.

Line 20: <h2>H2 Sample Text</h2>

Line 30: <h1>H1 Sample Text</h1>

Can someone tell me if this can be done?
User avatar
DigitalVolcano
Site Admin
Posts: 1731
Joined: Thu Jun 09, 2011 10:04 am

Re: Placing Text Elsewhere in html document

Post by DigitalVolcano »

Sorry, I don't think this can be done - you can't specify actions to happen on certain lines.

You can grab H1 text using

<h1>(.*)</h1>

and replace with H2 using

<h2>$1</h2>

but that will only replace the H1 tag with a H2 on the same line.
Post Reply