Solved

Find & replace in Dreamweaver code to: add +1 to many id's

Posted on 2013-06-22
3
272 Views
Last Modified: 2013-07-11
Hi,

I have many div's 300+ in a file in Dreamweaver and i was wondering if it is possible to search:
<div id="xxxx">

And replace that with:
<div id="_ftn1">

And the next with:
<div id="_ftn2">

And so on. This would save me tons of manual work! Is this possible with some kind of regual expression or something? If yes.. how?

Thanks
0
Comment
Question by:peps03
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 16

Assisted Solution

by:rbudj
rbudj earned 250 total points
ID: 39267945
I do not know of any automated way of doing this. Probably in the time it would take you to find a solution, you could just search for the id="xxxx" and then change it manually each time. Provided that you only have this one document. 300 should not take more that 10-20 minutes
0
 
LVL 26

Accepted Solution

by:
wilcoxon earned 250 total points
ID: 39268852
This will do what you want and leave the original file with .bak appended to the name.
perl -i.bak -pe 's{(<div\s+id=")[^"]+">}{$1."_ftn".(++$i)."\">"}e' input_file

Open in new window

0
 

Author Closing Comment

by:peps03
ID: 39317747
Thanks!!
Sorry for late reply!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you hate spam? I do, and I am willing to bet you do as well. I often wonder, though, "if people hate spam so much, why do they still post their email addresses on the web?" I'm not talking about a plain-text posting here. I am referring to the fa…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Six Sigma Control Plans

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question