?
Solved

How do I remove a line of code in dreamweaver

Posted on 2010-09-08
15
Medium Priority
?
375 Views
Last Modified: 2012-05-10
I have several pages that use the same code except for one number that changes in each instance.

          <a href="<?php echo "$sci",$num+4,".php"; ?>">Science</a><br />

the number 4 is what changes in each instance. I want to remove this line from each page in my document with "find & replace"

How would I write the "search for" to include all occurrences of this line?
0
Comment
Question by:ambantin
[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
  • 7
  • 5
  • 3
15 Comments
 
LVL 9

Expert Comment

by:khaledf
ID: 33632834
I would use notepad++ for this, dreamweaver is sometimes confusing when it comes to finding and replacing code.
0
 

Author Comment

by:ambantin
ID: 33632837
I have many pages and it is several times in each of the pages... I would like to do a "replace all"
0
 
LVL 9

Expert Comment

by:khaledf
ID: 33632863
use infoRapid Search & Replace tool.
very handy for replacements on multiple files
http://www.inforapid.de/html/srdownload.htm
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Author Comment

by:ambantin
ID: 33632865
OK just installed notepad++ how would I write the "find what" to include all occurrences?
0
 

Author Comment

by:ambantin
ID: 33632876
lol..ok just installed infoRapid... how would I write the "search for" to include all occurrences?
0
 
LVL 9

Expert Comment

by:khaledf
ID: 33632885
since you want to change it on multiple files then better use InfoRapid as it is free and versatile.

isn't this the line you want to remove?
<a href="<?php echo "$sci",$num+4,".php"; ?>">Science</a><br />

just search for it
0
 

Author Comment

by:ambantin
ID: 33632893
but the the number "4" is different in every instance (1,2,3,4,5,6,7...)
0
 
LVL 9

Expert Comment

by:khaledf
ID: 33632902
for me I would right click on the folder containing my files then select search with inforapid
then in the search tap put it in the "search for" field

then in the replace tab type a space in the replace with field
thats it
:)
0
 

Author Comment

by:ambantin
ID: 33632929
the numeral 4 that is in the line of code is not in every instance of the code... it is a different number in each occurrence.. so I would need some type of a wildcard...
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 33633027
Hi ambatin,

You do not need a third party program to do this.  Dreamweaver supports regular expressions in its Find and Replace functions.  Do Edit | Find and Replace and set the options as follows:

Find in: Entire Current Local Site
Search: Source Code
Find:

<a href="<\?php echo "\$sci",\$num\+[0-9],".php"; \?>">Science</a><br />

Replace: leave it blank.
Options: Check "Use regular expression" and clear "Match case"

Run it.  The magic happens with the [0-9] section which will match any one number.  Since this is a regular expression, we have to escape all ? $ + symbols which is done by a backslash \
0
 
LVL 9

Accepted Solution

by:
khaledf earned 1000 total points
ID: 33633073
hi,

you can do it like this

(<a href="<\?php echo "\$sci",\$num\+).(,"\.php"; \?>">Science</a><br />)

0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 33633107
Which is basically the same as my solution, only done with a different regex method.
0
 

Author Comment

by:ambantin
ID: 33633176
ok..what if the numbers go from 0-135
0
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 1000 total points
ID: 33633180
Use:

<a href="<\?php echo "\$sci",\$num\+[0-9]+,".php"; \?>">Science</a><br />

instead
0
 

Author Closing Comment

by:ambantin
ID: 33633492
Thanks guys
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

752 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