[Tutor] Copy script

Alan Gauld alan.gauld at btinternet.com
Thu Apr 10 02:46:49 CEST 2008


"Que Prime" <queprime at gmail.com> wrote

>I have a folder of 150,000 pdf files and I need to copy 20,000 of 
>them to
> another folder.  The ones I need to copy are in a .txt file.

Sounds straightforward but...

> Attached is a
> sample of the input .txt file and a dos directory of the folder 
> containing
> the files.  I'm not sure of the best way to accomplish this.
>
> Thank you in advance for your help.
>
> Sample input file:
>
> 12347424
> 12347425
>
> Sample dir on folder:
> 03/20/2008  09:21 AM           145,257 000000011479
> [7ac0c741-9d2f-4a1d-9dbf-8de27ca0abb4].pdf

I don;t see how the input file relates to the pdf files?
Which part of the pdf file does the input numbers refer to?

However it may be that the DOS FOR command with
the /F option may be adapted to do what you want.
It iterates over the content of a file performing a
command per item in the file... Try Help FOR to get
more info and try experimenting... DOS is a braindead
beast but does sometimes have the facilities needed...

The XP DOS commands are considerably more powerful
than the old DOS set. Some of them even have a Unix like
backtick facility!

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld




More information about the Tutor mailing list