How to detect all files with pattern *dat* which do not have path pattern *log* ?

  • Thread starter Martin Caldwell
  • Start date
M

Martin Caldwell

I would like to list all files with the pattern *dat* in my whole directory tree
whose path does NOT contain the pattern *log*. How do I get this list ?

For example:

D:\xxx\yyy\file20051130.dat
D:\kkk\bbb\datall.txt

Should be listed but not:

D:\aaa\bbb\mylogs\ccc\today.dat

The "normal" dir command does NOT offer this kind of search.

Martin
 
B

billious

Martin Caldwell said:
I would like to list all files with the pattern *dat* in my whole directory
tree
whose path does NOT contain the pattern *log*. How do I get this list ?

For example:

D:\xxx\yyy\file20051130.dat
D:\kkk\bbb\datall.txt

Should be listed but not:

D:\aaa\bbb\mylogs\ccc\today.dat

The "normal" dir command does NOT offer this kind of search.

Martin

DIR /s/b D:\*dat* | findstr /i /v /r ".*\\.*log.*\\.*"

should do the trick.

findstring - case-insensitive - not containing - regular expression
- any number of any characters
- slosh
- any number of any characters
- literal "log"
- any number of any characters
- slosh
- any number of any characters


NT/2K/XP batch techniques : alt.msdos.batch.nt

HTH

....Bill
 
P

Pegasus

Martin Caldwell said:
I would like to list all files with the pattern *dat* in my whole directory tree
whose path does NOT contain the pattern *log*. How do I get this list ?

For example:

D:\xxx\yyy\file20051130.dat
D:\kkk\bbb\datall.txt

Should be listed but not:

D:\aaa\bbb\mylogs\ccc\today.dat

The "normal" dir command does NOT offer this kind of search.

Martin

Start a command prompt, then type either of the following commands:

dir d:\*.* /s /a-d | find /i /v "log" | more
dir d:\*.* /s /a-d /b | find /i /v "log" | more
 
B

billious

Martin Caldwell said:
I would like to list all files with the pattern *dat* in my whole directory
tree
whose path does NOT contain the pattern *log*. How do I get this list ?

For example:

D:\xxx\yyy\file20051130.dat
D:\kkk\bbb\datall.txt

Should be listed but not:

D:\aaa\bbb\mylogs\ccc\today.dat

The "normal" dir command does NOT offer this kind of search.

Martin

DIR /s/b D:\*dat* | findstr /i /v /r ".*\\.*log.*\\.*"

should do the trick.

findstring - case-insensitive - not containing - regular expression
- any number of any characters
- slosh
- any number of any characters
- literal "log"
- any number of any characters
- slosh
- any number of any characters


NT/2K/XP batch techniques : alt.msdos.batch.nt

HTH

....Bill
 
B

billious

billious said:
DIR /s/b D:\*dat* | findstr /i /v /r ".*\\.*log.*\\.*"

should do the trick.

findstring - case-insensitive - not containing - regular expression
- any number of any characters
- slosh
- any number of any characters
- literal "log"
- any number of any characters
- slosh
- any number of any characters


NT/2K/XP batch techniques : alt.msdos.batch.nt

HTH

...Bill

Ahh - because it's been crossposted, so we select what - the LAST nominated
group?

Thanks for the quality software, Mr. Gates.

....Bill
 
B

billious

David Candy said:
You just click Reply Group.

Hmm...yes, did just that. Twice - on the incarnation of this message in
microsoft.public.windowsxp.general - second time because the response hadn't
shown up in that group.

Looks like it's selecting the "followup to" group(s) rather than the
posted-to groups - which seems logical, in a twisted sort of a way.

Can't see why, if this is SOP, Bill doesn't generate a message warning that
the reply WON'T appear in the same group as that originally selected. So
many meaningless warnings, and no useful ones...

....Bill
 
D

David Candy

I see what you mean. He really needs his heads punched in. This is a usual troll trick using follow ups.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top