ignore files

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
glob5
Posts: 34
Joined: 23 Nov 2010 00:47

ignore files

#1 Post by glob5 » 23 Nov 2010 00:52

for /f "tokens=*" %%n in ('dir /s/b %1\*mydir*') do call :A1 "%%n"
:A1
pushd %~1
for %%D in (*myfile*.txt) do ( for /f "tokens=1 delims=+" %%H in ("%%~nD") do (
.. do stuff
goto do
)
)
:do
..do stuff
popd
:end

In the for %%D in .. line, how to skip "*myfile*.txt files that has the word "EPQ" in them?. :?:

amel27
Expert
Posts: 177
Joined: 04 Jun 2010 20:05
Location: Russia

Re: ignore files

#2 Post by amel27 » 23 Nov 2010 19:38

glob5 wrote:In the for %%D in .. line, how to skip "*myfile*.txt files that has the word "EPQ" in them?.

Code: Select all

for %%D in (*myfile*.txt) do (
  findstr "EPQ" "%%D">nul|| for /f "tokens=1 delims=+" %%H in ("%%~nD") do (
    echo %%H
  )
)


- "goto do" command interrupt FOR loop in first pass, only one file processed;
- each "CALL :SUB" command must be ended with GoTo:EOF in SUB procedure.

Post Reply