Assuming that each dile has a dash in front and that
their is never a space in the file name and the report is
in a fix format (the file names line up), I will make believe that
the file names start in column 35:
setlocal ENABLEDELAYEDEXPANSION
for /f "Tokens=*" %%a in ('type report.txt^|findstr /c:"-"') do (
set line=%%a
set work=!line:~34!
for /f "Tokens=1" %%b in ('@echo !work!') do (
set file=%%b
if not exist !file! @echo File !file! not found.
)
)
On Thu, 15 Jul 2004 04:10:50 -0700, "Mikhail"
<(E-Mail Removed)> wrote:
>hi,
>
>I have a report that needs to be check in directories. The
>format of the report is something like this:
>
>report1 - File1 (done)
> File2
>report2 - File3 (done)
>report2 - File4 (Pending)
> - File5
> etc.
>
>
>How can I check if the files (File1 to File5) in the
>report exist in the directories. How can I eliminate the
>characters before and after the filenames. My idea is to
>create a list then use for /f "Tokens=*" %%a in
>(c:\report1.txt) echo %%a >> report2.txt to make another
>report then check the files in the directories.
>
>output of report1.txt is
>
>File1
>File2
>File3
>File4
>File5
>
>any other ideas?
>
>thanks in advance,
>
>Mikhail
Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com