PC Review


Reply
Thread Tools Rate Thread

Check report files in directories

 
 
Mikhail
Guest
Posts: n/a
 
      15th Jul 2004
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
 
Reply With Quote
 
 
 
 
foxidrive
Guest
Posts: n/a
 
      15th Jul 2004
On Thu, 15 Jul 2004 04:10:50 -0700, Mikhail wrote:

> I have a report that needs to be check in directories. The
> format of the report is something like this:


"something like this" is seldom accurate anough - it would be far better to
see a genuine sample file.

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

 
Reply With Quote
 
Jerold Schulman
Guest
Posts: n/a
 
      15th Jul 2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
App to examine / check video files, report on codec, other attribu John Bartley K7AAY Windows XP Video 2 18th Dec 2007 10:54 PM
Copying JPEG image files to new directories makes directories unus =?Utf-8?B?U2ltb24gUC4=?= Windows XP Help 0 29th Jan 2007 02:21 AM
check your site popularity in all major search engines and directories. Nicole Microsoft Frontpage 2 11th Aug 2005 11:33 AM
Some files on this volume could not be defragmented check the report Jitesh Biswas Windows XP General 1 15th Jul 2004 07:12 AM
Check permission on files and directories Jonas Nilsson Microsoft ASP .NET 2 13th Aug 2003 02:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:41 AM.