Forum Moderators: open

Message Too Old, No Replies

Reverse Find & Replace

Locating a page where something doesn't exist

         

eWhisper

8:34 pm on Jun 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



After doing several find & replaces to update some link structures, occasionally I'm finding a page where everything wasn't updated.

Is there a way to do a search through html or txt files to find out if a certain string isn't on that page?

WhosAWhata

10:32 pm on Jun 7, 2004 (gmt 0)

10+ Year Member



you can do that with PHP
<?

//don't change this
function is_it_there($string,$file){
$text = file_get_contents($file);
if(eregi($string,$text)) {
return "string is there";
} else {
return "string is not there";
}
}

//this is how you check
echo is_it_there("my text","myfile.txt");
?>

mozopera

1:21 am on Jun 8, 2004 (gmt 0)

10+ Year Member



If you have GNU grep on your system, it's a simple matter of using the "-l" option (ie dash el not dash one), which prints files that do not have the matching line.