Hi, This is a tough one to find on Google. I can't find it in notepad++ nor netbeans. Is there a utility that can search for files (webpages) that do not contain a string and list those files? I am currently hoping to find this under windows.
Thanks,
John
Listing files with string not found
Moderator: General Moderators
Re: Listing files with string not found
I found a sneaky way to do this.
1/ In notepad++ search files for the string you are after.
2/ right click in the search results box and click "Select all"
3/ right click in the search results box and click "copy"
4/ past this into a new notepad++ editor page.
5/ Use regular expressions to clear any stuff you do not want moved down to a blank line.
6/ use regular expressions to modify the files that are left into a move command "move "C:\whatever\whatever.php" "C:\TargetDirectory\"
7/ save this as a move.bat file
8/ run the move.bat file
9/ The files left in the original directory are the ones without the string.
10/ Put the moved files back.
A not found search would be much easier that the above but this is easier than checking 200 files for something missing.
1/ In notepad++ search files for the string you are after.
2/ right click in the search results box and click "Select all"
3/ right click in the search results box and click "copy"
4/ past this into a new notepad++ editor page.
5/ Use regular expressions to clear any stuff you do not want moved down to a blank line.
6/ use regular expressions to modify the files that are left into a move command "move "C:\whatever\whatever.php" "C:\TargetDirectory\"
7/ save this as a move.bat file
8/ run the move.bat file
9/ The files left in the original directory are the ones without the string.
10/ Put the moved files back.
A not found search would be much easier that the above but this is easier than checking 200 files for something missing.
Last edited by bowlesj on Wed Jan 21, 2015 8:17 am, edited 2 times in total.
Re: Listing files with string not found
Re: Listing files with string not found
Thanks Celauran. It is amazing how we forget. I used to know (sed, awk, grep, bash from linux and ksh) sooooooooooo well about 15 years ago then I left the unix world and I will need to learn some of it all again pretty much fresh from the start.
John
John
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Listing files with string not found
I use these grep options all the time, they are very handy to know:
-L, --files-without-match
-v, --invert-match
-L, --files-without-match
-v, --invert-match
(#10850)
Re: Listing files with string not found
Thanks Christopher, I am going to install cygwin soon and try to learn enough to do this within the next 2 weeks. Back to the days of unix soon.
John
John