Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-06-22
3
Medium Priority
?
279 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 1000 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 1000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

by Batuhan Cetin Regular expression is a language that we use to edit a string or retrieve sub-strings that meets specific rules from a text. A regular expression can be applied to a set of string variables. There are many RegEx engines for u…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
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

715 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