Computing.Net > Forums > Windows 2000 > Batch file to read from file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to get for your free account now!

Batch file to read from file

Reply to Message Icon

Name: ikerstges
Date: February 8, 2006 at 03:35:26 Pacific
OS: Windows 2000
CPU/Ram: PIII650/512
Comment:

Hi,

I have an output-list (master.txt) that consists of multiple lines. Each line contains a (part of a-) filename.

Example:
orderref_010134
orderref_010135
orderref_010139

I want to use a batchfile to find any files from a directory and it's subdirectories that contain each of those lines.

Something like:
xcopy *orderref_010134* c:\collect /s /y
xcopy *orderref_010135* c:\collect /s /y
xcopy *orderref_010139* c:\collect /s /y

So I will end up with only the files that have these names in them.

I hope I'm clear with my question?

(I need to process such a list, hundreds of orderfiles each month. I'm doing that manually in Windows Explorer now by searching orderref_010134,orderref_010135,orderref_010139 which produces the result I need. If I could batch this action, I would use it to create a zip-file and email it automatically with blat to the person who needs those files)


Report Offensive Message For Removal

Sponsored Link
Ads by Google

Response Number 1
Name: dtech10
Date: February 8, 2006 at 14:32:25 Pacific
Reply:

Hi
Do you mean something like this.

@echo off
cd Temp
dir /b /s | find "orderref_01134" > Files.txt
dir /b /s | find "orderref_01135" >> Files.txt
dir /b /s | find "orderref_01139" >> Files.txt

for /f %%a in (Files.txt) do copy %%a \Collect > nul
echo Done!


Report Offensive Follow Up For Removal

Response Number 2
Name: ikerstges
Date: March 7, 2006 at 00:48:34 Pacific
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: Batch file to read from file

win 2k tries to read from a: drive every time I right click www.computing.net/answers/windows-2000/win-2k-tries-to-read-from-a-drive-every-time-i-right-click/8757.html

Batch file commands in win2000 www.computing.net/answers/windows-2000/batch-file-commands-in-win2000/57027.html

Reading input from a batch file www.computing.net/answers/windows-2000/reading-input-from-a-batch-file/51608.html