Dir - case selection possible??

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Jun 7, 2008
121
0
#1
Hi

As we all know, Windows is case-insensitive but case-retentive for filenames.

If I list files that begin with UKP and end in zip, I see

01/04/2010 15:35 204,029,735 UKP100324.ZIP
06/04/2010 15:06 133,118,408 UKP100325.zip
06/04/2010 15:06 123,987,041 UKP100326.zip
06/04/2010 15:07 127,271,920 UKP100327.zip
06/04/2010 15:07 109,755,475 UKP100328.zip
06/04/2010 16:38 130,352,858 UKP100329.ZIP
07/04/2010 14:59 200,622,328 UKP100330.ZIP
08/04/2010 14:59 195,898,325 UKP100331.zip


Now I want to list only those with ".ZIP" as an extension, not ".zip"
(Those with .ZIP have had extra files added and password protection applied to some of those).

Is that possible with TCC 11.00.44?

Thanks

Stephen Howe
 
May 29, 2008
517
3
Groton, CT
#2
Hi

As we all know, Windows is case-insensitive but case-retentive for filenames.

If I list files that begin with UKP and end in zip, I see

01/04/2010 15:35 204,029,735 UKP100324.ZIP
06/04/2010 15:06 133,118,408 UKP100325.zip
06/04/2010 15:06 123,987,041 UKP100326.zip
06/04/2010 15:07 127,271,920 UKP100327.zip
06/04/2010 15:07 109,755,475 UKP100328.zip
06/04/2010 16:38 130,352,858 UKP100329.ZIP
07/04/2010 14:59 200,622,328 UKP100330.ZIP
08/04/2010 14:59 195,898,325 UKP100331.zip


Now I want to list only those with ".ZIP" as an extension, not ".zip"
(Those with .ZIP have had extra files added and password protection applied to some of those).

Is that possible with TCC 11.00.44?

Thanks

Stephen Howe
Try this:
Code:
for %%xx in (ukp*.zip) if .%@ext[%xx] eqc .ZIP  dir /k /m %xx
 
#3
Regular expressions can have the case sensitivity turned off

*dir ::(?-i)\.ZIP$

On Thu, Apr 8, 2010 at 8:12 AM, dcantor <> wrote:


> ---Quote (Originally by Stephen Howe)---
> Hi
>
> As we all know, Windows is case-insensitive but case-retentive for
> filenames.
>
> If I list files that begin with UKP and end in zip, I see
>
> 01/04/2010 15:35 204,029,735 UKP100324.ZIP
> 06/04/2010 15:06 133,118,408 UKP100325.zip
> 06/04/2010 15:06 123,987,041 UKP100326.zip
> 06/04/2010 15:07 127,271,920 UKP100327.zip
> 06/04/2010 15:07 109,755,475 UKP100328.zip
> 06/04/2010 16:38 130,352,858 UKP100329.ZIP
> 07/04/2010 14:59 200,622,328 UKP100330.ZIP
> 08/04/2010 14:59 195,898,325 UKP100331.zip
>
> Now I want to list only those with ".ZIP" as an extension, not ".zip"
> (Those with .ZIP have had extra files added and password protection applied
> to some of those).
>
> Is that possible with TCC 11.00.44?
>
> Thanks
>
> Stephen Howe
> ---End Quote---
> Try this:
>
> Code:
> ---------
> for %%xx in (ukp*.zip) if .%@ext[%xx] eqc .ZIP dir /k /m %xx
> ---------
>
>
>
>


--
Jim Cook
2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Monday.
 
Jun 7, 2008
121
0
#4
Hi

I have resorted to using find. Works well enough:

dir UKP*.ZIP | find /v ".zip"
dir UKP*.ZIP | find /v ".ZIP"

Just the "bytes in N files" is not right but I can live with that.

I tried RegExpressions but could not figure it out.
Some worked examples would not go amiss for each discussed RegExpression element in the help file.

Thanks for the responses

Stephen Howe