Saved Bookmarks
| 1. |
Solve : recursive find work around?? |
|
Answer» I am working on a way to find all images used in all my webpages using this to search the files in a directory and print the RESULTS. Ultimately what I would like to do is get a good enough report so that I can do some housekeeping on the image folder. <img src="images/firewise.jpg" width=311 height=64 border=0 alt="Fire Wise website"> ---------- INDEX.HTM [35] [50] So far this is GREAT for SEARCHING just that SPECIFIC folder. Is there a way to recurse the search so that it penitrates all subdirectories also? All the information I find says you can not do a recursive "find" if that is true can I determine the directory structure with a command before the "find" and then loop until all directories have been gone through? Also is there a way to format the output a little you can see that under INDEX.HTM the tags are right up against the line number ( I like this) but in HOMEFIRE.HTM line 35 and 52 have a space before the tag.yes you can ... :: clear the logfile Rem>found.log FOR /D %A IN (*.*) DO call MyFind %A (in a batch file, call the variables %%A) -- this will walk the directory tree recursively from the current dir then create MyFind.Bat cd %~f1 find /n /i " Graham OK after testing it appears to be attempting to step down each time if finds a subdirectory and only at the first subdirectory. It would probably work if I had the directory then just one subdir and then just one subdir inside that and so on. what I have is a main dir with multiple subdirectories that also have multiple subdirectories. I hope this makes since.Ive just had a quick play, change the FOR to read FOR /D /R ......... the /R means recursive, sorry I thought the /D would have done that Graham |
|