Replace text not working all the time

General questions about using WildEdit

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
videotoys
Posts: 4
Joined: Wed Jul 05, 2006 3:25 pm

Replace text not working all the time

Post by videotoys »

I have about 1000 .php web pages I need to find/replace all at once, a simple multiline tag thats the same in all 100 pages, with a shorter multiline tag. it works every now and then to replace the text but sometimes it doesnt.

To explain more: I use textpad, copy my text, paste into wildedit's Find what field. Then copy/paste the replace with text into that field, I add the *.php to files matching field, check search subfolders box and hit play, but no replacements are made, not even the file I copied the text from.

Maybe Im doing something wrong or not doing something, (this has been an issue for a long time now and now I need it most, so I thought Id ask if anyone has any tips. Thanks
videotoys
Posts: 4
Joined: Wed Jul 05, 2006 3:25 pm

Post by videotoys »

In case it helps to understand what might be my problem, I am trying to replace pretty basic html with PHP includes so something like this:

Code: Select all

        <div class="righttable">
        <table>
        <td>
		 	<a href="http://www.autochannel1.com/boulder/"><img src="http://www.boulderchannel1.com/links/boulderautochannel1.jpg" style="width:15;height:15;filter:alpha(opacity=100)" /onmouseover="this.filters.alpha.opacity=40" /onmouseout="this.filters.alpha.opacity=100" /onmousedown="this.filters.alpha.opacity=100"  alt="Boulder Auto Channel 1" border="0" height="100" width="100"></a><br><br>
			<a href="http://www.boulderchannel1.com/channel4.php"><img src="http://www.boulderchannel1.com/links/cuboulder.jpg" style="width:15;height:15;filter:alpha(opacity=100)" /onmouseover="this.filters.alpha.opacity=40" /onmouseout="this.filters.alpha.opacity=100" /onmousedown="this.filters.alpha.opacity=100"  alt="C.U. Boulder Channel 4" border="0" height="100" width="100"></a><br><br>
			<a href="http://www.homeandgardenchannel1.com/boulder/"><img src="http://www.boulderchannel1.com/links/boulderrealestateandhome.jpg" style="width:15;height:15;filter:alpha(opacity=100)" /onmouseover="this.filters.alpha.opacity=40" /onmouseout="this.filters.alpha.opacity=100" /onmousedown="this.filters.alpha.opacity=100"  alt="Boulder Real Estate, Home &amp; Garden Channel 1" border="0" height="100" width="100"></a>
        </td>
        <td>
		 	<a href="http://www.foodchannel1.com/boulder/"><img src="http://www.boulderchannel1.com/links/boulderrestaurantchannel1.jpg" style="width:15;height:15;filter:alpha(opacity=100)" /onmouseover="this.filters.alpha.opacity=40" /onmouseout="this.filters.alpha.opacity=100" /onmousedown="this.filters.alpha.opacity=100"  alt="Boulder Restaurant Channel 1" border="0" height="100" width="100"></a><br><br>
			<a href="http://www.boulderchannel1.com/sports/boulder/"><img src="http://www.boulderchannel1.com/links/bouldersportschannel1.jpg" style="width:15;height:15;filter:alpha(opacity=100)" /onmouseover="this.filters.alpha.opacity=40" /onmouseout="this.filters.alpha.opacity=100" /onmousedown="this.filters.alpha.opacity=100"  alt="Boulder Sports &amp; Fitness Channel 1" border="0" height="100" width="100"></a><br><br>
			<a href="http://www.boulderchannel1.com/fashion/boulder/"><img src="http://www.boulderchannel1.com/links/boulderfashionchannel1.jpg" style="width:15;height:15;filter:alpha(opacity=100)" /onmouseover="this.filters.alpha.opacity=40" /onmouseout="this.filters.alpha.opacity=100" /onmousedown="this.filters.alpha.opacity=100"  alt="Boulder Fashion Channel 1" border="0" height="100" width="100"></a>
        </td>
        </table>
		</div>
with something like this:

Code: Select all

        <div class="righttable">
			<? include('http://www.boulderchannel1.com/ssi/boulderright.txt'); ?>
		</div>
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Did you deselect Regular expression? Your example search text contains parentheses, which have a special meaning in regular expressions.
justinb
Posts: 1
Joined: Thu Feb 08, 2007 10:04 pm

same problem

Post by justinb »

I had a very simple find and replace, and it worked on maybe 80% of the files.. I was searching for

<a id="recommendButton" href="mailto:">

replacing with
<a id="recommendButton" onclick="RecommendToFriendEmail();">

On the files it didn't work on, I loaded them up as a test file, and it did the find and the replace. Are some of these files not getting opened? There is definitely a bug here.

Also, I closed the program, reopened it, clicked the same settings (search subfolders, files matching *.html *htm), and this time it appears to have done the replacement on all pages this time.
Daniel Friedman
Posts: 2
Joined: Sat Jul 28, 2007 3:59 pm
Contact:

Wild Edit sometimes won't edit

Post by Daniel Friedman »

I too have had intermittent failures of WildEdit to recognize and change a text string in my .html files. Sometimes it is maddeningly random - I've tried stopping and restarting WildEdit and even re-booting. Usually the probgram works like a charm but when it doesn't it's the pits.

Here are some things I've tried:

- make sure none of the options like "regular expression" are checked - I use only the "Search subfolders" option

- make sure the "In files matching" is set to the proper name or wildcard - for example I use *.htm*

- Make sure you've chosen the right character encoding. I WISH I had some reliable guideline on this myself. I set the encoding to windows-1252. I've experimented with other encodings with no difference in results except that some of them will give error messages on my text strings.

- make DOUBLE SURE you haven't accidentally moved yourself to another directory folder before running the WildEdit change function - on occasion I'll deliberately click on another subdirectory so that I can have WildEdit delete the backup files it's kept - when I am satisfied with the changes it made. Doing so and forgetting to click back to the proper directory is easy to miss and can of course result in no matches in your "find what" string.

- check that there is not some subtle difference between your "Find what" string and the actual text in the files you want to change. Sometimes a blank line has crept into the file, or some files have even the tiniest difference that is not at first obvious. Especially if the Find string is a long one.

- Restarting WildEdit or rebooting have made no difference.

All of this said: I TEST Wild Edit when I can't get it to work on a file, by copying the "find" string directly from the file I want to see changed - I figure that way the Find function can't complain that I missed something.
Yet sometimes the function simply doesn't do anything.

Lost in Mexico.

Daniel F.
Daniel Friedman
www.inspect-ny.com
Daniel Friedman
Posts: 2
Joined: Sat Jul 28, 2007 3:59 pm
Contact:

Wild Edit sometimes won't edit

Post by Daniel Friedman »

To my earlier list of things to watch out for when Wild Edit doesn't find the text string we want to replace

-make sure you haven't accidentally put a space, spaces, or line break (carriage return) at the end of your "find what" search text.
It's easy to make that mistake when copying the search argument using most text editors.

what I do is put my cursor at the end of the search text argument, hold the left mouse button down, move the mouse to the right, and see if I am highlighting blanks that I didn't intend.
Daniel Friedman
www.inspect-ny.com
Post Reply