I want to exclude the debug/troubleshooting log files in my directory
search, but am having a hard time with that using the DIR command.
Here's the closest thing I could come up with, but obviously I can't
figure out how to add multiple exclude files here:
dir /b/s | find /v /i "rplib.log"
Any other suggestions are appreciated!
Hank
Use findstr instead of find.
dir /b/s | findstr /v /i "rplib\.log$ ms\.log$"
Findstr uses regex syntax by default and allows multiple keys separated
with spaces.
The regex syntax forces escaping of dots dollar and ^ (which are special
chars) with a leading backslash.
The ^ anchors a key at line begin, a dollar sign at the end.
The search strings may also be feed from a file (one key per line) with
the /G:filename.ext option.
For more info enter in cmd window:
findstr /?
or for the more detailed windows help
HH ntcmds.chm::/findstr.htm
--
HTH
Matthias
Thanks for the help. One more question. There's some filenames that
look like this:
ccmtrace.log
ccmtrace.log.back
ccmrdk.log
ccmblk.log
I've tried regex using ccm.$, ccm*$, ccm$, but obviously I'm not
getting it. I've looked at some regex tutorials, but they're not
helping much.
Thanks
Hank
On Feb 3, 11:46 am, Hank <hammerin.hanks...@gmail.com> wrote:
>
> I have a need to search for specific files in an application's temp
> folder that have random names like HotFixxxx.log, Patchxxx.log, and
> NewestModule.log. Unfortnately, this same folder contains the app's
> temp log files used for debugging and troubleshooting. Filenames like
> rplib.log, ms.log, etc.
>
> I want to exclude the debug/troubleshooting log files in my directory
> search, but am having a hard time with that using the DIR command.
Try 1DIR: (e.g., "1dir /!*.lzh,*.arj,*.zip,*.7z")
ccm.*$
should do, but take care the .* is greedy, if ccm appears somewhere
in the path like soccmatch\xyz.log this would match also.
--
HTH
Matthias
Got it! Thanks Matthias!
Hank