Web Hosting Talk







View Full Version : searching for a text string?


horoscopes2000
12-01-2001, 12:49 PM
Hi people,

I need to find out if there is a way of searching a RaQ3 for the presence of a certain text string *within* any of the *.htm files on the drive?

My ISP (AT&T@Home) has just changed my email address without notice, from @home.com to @attbi.com

This means each and every one of my forms and email addresses needs to be changed.

I have alrwady instigated a global search and replace of all .htm files on my PC's hard disk, and am setting about uploading the amended files, but I want to search my RaQ afterwards to make sure I have changed all the appropriate files and not missed any.

I have just changed 1035 files (aargh).

Can this be done? (please say yes).

What a nightmare.

Lawrence
12-01-2001, 09:26 PM
Try:

grep 'search string (regexp)' /*.htm

Might have to play around with it a bit, but something like that should work.

Mike the newbie
12-01-2001, 10:24 PM
The following will find the string "testtest" in any file on the disk.

find / -exec grep -l "testtest" {} \; 2> /dev/null

For just the sites, try

find /home/sites -exec grep -l "testtest" {} \; 2> /dev/null


I don't have the time at the moment to play with limiting the search to just .htm or .html files, but the above will give you the info you need, albeit somewhat verbously.

Mike the newbie
12-01-2001, 10:39 PM
Originally posted by Mike the newbie
albeit somewhat verbously.
good grief... I can't believe I did that to verbosely....

horoscopes2000
12-02-2001, 03:28 PM
I just wanted to thank you both for your replies. I can't wait to try this out. Once again, many thanks.

horoscopes2000
12-02-2001, 03:36 PM
Works like a dream! You guys are absolute stars, and have really helped me out of a tough situation. :)

Mike the newbie
12-02-2001, 10:04 PM
:blush: