Computing.Net > Forums > Disk Operating System > copying files listed in a text 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 start participating now! Also, be sure to check out the New User Guide.

copying files listed in a text file

Reply to Message Icon

Name: Kevin P. Alexander
Date: July 13, 2001 at 10:52:48 Pacific
Comment:

Does anyone know of a method to copy files from a list stored in a text file? It could be a Command Prompt like:

c:\ copy < source_files.txt c:\destination

I suspect their is some type of 'redirect' option to force the reading of a text file for input to the 'source' side of the copy operation, but I haven't found anything.

Thanks in advance.

Kevin
System Consultant



Sponsored Link
Ads by Google

Response Number 1
Name: camina
Date: July 13, 2001 at 23:52:57 Pacific
Reply:

using a command such as your example,
you'll make a copy of the actual text file, and put it in the destination directory.

thats a great question. It would be made into a batch file, perhaps that would work.
with some stuff like

@echo off
copy *.* c:\destination
:end

make a batch file.

name it what ever you want.bat
have your target files somewhere (a:drive?)
tell the batch file
copy a:\*.* c:\destination
inside the batch file.

sounds close to me.

good luck.


0

Response Number 2
Name: jboy
Date: July 14, 2001 at 16:13:05 Pacific
Reply:

Perhaps a variant of 'For.. In.. Do'

for %%x (file1,file2,file3) do copy c:\target %%x

but to get the list of files into the brackets with commas ....

not so sure, but might be worth exploring



0

Response Number 3
Name: HarveyChopsUK
Date: August 1, 2001 at 10:24:16 Pacific
Reply:

What you need is a file text replace tool. I use one called FR which you can find on

http://www.openinformationsystems.com/provalov/tony/

So you can could enter the following commands (or create a batch file):

--
c:
dir /s/b > copyme.dat
fr copyme.dat c: "copy c:" copyme.bat
d:
c:copyme.bat
--

So this would replace all the 'c:' text with 'copy c:' into a another batch file called copyme.bat, which you could then run from a directory, which would then copy all the files in the copyme.dat text file over!

The copyme.dat file would look like:
c:\winnt\system32\ansi.sys

And after it's been FR'd it'd look like:

copy c:\winnt\system32\ansy.sys

You can't add a drive letter to the end of the line though, which is why you need to run it from another drive or directory.

Hope this makes some sense..

PorkChops aplenty


0

Sponsored Link
Ads by Google
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 Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: copying files listed in a text file

Batch to get from a list in a file. www.computing.net/answers/dos/batch-to-get-from-a-list-in-a-file/14009.html

store processing result in a text file www.computing.net/answers/dos/store-processing-result-in-a-text-file/7409.html

Read batch file and write in a Text www.computing.net/answers/dos/read-batch-file-and-write-in-a-text/16653.html