Tech Support > Microsoft Windows > Help and Support > How to detect all files with pattern *dat* which do not have path pattern *log* ?
How to detect all files with pattern *dat* which do not have path pattern *log* ?
Posted by Martin Caldwell on December 4th, 2005


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

Posted by billious on December 4th, 2005



"Martin Caldwell" <martinca20@hotmail.com> wrote in message
news:43931699$0$20849$9b4e6d93@newsread2.arcor-online.net...
>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


Posted by Pegasus on December 4th, 2005



"Martin Caldwell" <martinca20@hotmail.com> wrote in message
news:43931699$0$20849$9b4e6d93@newsread2.arcor-online.net...
> 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


Posted by billious on December 5th, 2005



"Martin Caldwell" <martinca20@hotmail.com> wrote in message
news:43931699$0$20849$9b4e6d93@newsread2.arcor-online.net...
>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



Posted by billious on December 5th, 2005



"billious" <billious_1954@hotmail.com> wrote in message
news:4393f3ba$0$15356$a82e2bb9@reader.athenanews.c om...
>
> "Martin Caldwell" <martinca20@hotmail.com> wrote in message
> news:43931699$0$20849$9b4e6d93@newsread2.arcor-online.net...
>>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
>
>
>


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

Thanks for the quality software, Mr. Gates.

....Bill


Posted by David Candy on December 5th, 2005


You just click Reply Group.

--
--------------------------------------------------------------------------------------------------
Read David defending the concept of violence.
http://margokingston.typepad.com/har...e_ga.html#more
=================================================
"billious" <billious_1954@hotmail.com> wrote in message news:4393f67a$0$15351$a82e2bb9@reader.athenanews.c om...
>
> "billious" <billious_1954@hotmail.com> wrote in message
> news:4393f3ba$0$15356$a82e2bb9@reader.athenanews.c om...
>>
>> "Martin Caldwell" <martinca20@hotmail.com> wrote in message
>> news:43931699$0$20849$9b4e6d93@newsread2.arcor-online.net...
>>>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
>>
>>
>>

>
> Ahh - because it's been crossposted, so we select what - the LAST nominated
> group?
>
> Thanks for the quality software, Mr. Gates.
>
> ...Bill
>
>

Posted by billious on December 5th, 2005



"David Candy" <.> wrote in message
news:e3DCPVX%23FHA.3980@TK2MSFTNGP14.phx.gbl...
> 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


Posted by Bob I on December 5th, 2005


Dir *.dat > c:\Datlist.txt
find /V "log" C:\datlist.txt



Martin Caldwell wrote:

> 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
>


Posted by David Candy on December 5th, 2005


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

--
--------------------------------------------------------------------------------------------------
Read David defending the concept of violence.
http://margokingston.typepad.com/har...e_ga.html#more
=================================================
"billious" <billious_1954@hotmail.com> wrote in message news:43943442$0$15347$a82e2bb9@reader.athenanews.c om...
>
> "David Candy" <.> wrote in message
> news:e3DCPVX%23FHA.3980@TK2MSFTNGP14.phx.gbl...
>> 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
>
>