Selecting files from a list.

Soldato
Joined
17 Aug 2004
Posts
3,511
Location
Houston, TX
Ok guys i could really use some help here.

I have a large folder full of 5000+ files, and i want to copy out certain ones. I have a list of about 750 that i want so is there any way i can run a query to drag them out.

I know one of the IT managers here has done it before using UNIX code in the windows command prompt environment, but i really need to figure this out myself.

Thanks.
 
ugly/brute force way

stick list of names in Excel, column B

in column A, insert "COPY ", drag-repeat to line 750
in column C, insert "c:\temp ", drag-repeat to line 750

export to batch file
run
----

there is some clever way using FOR loop with pointer to text file, not got it to hand at the 'mo

hth. :)
 
Last edited:
just bashed out this script for you.... not pretty, but better than above.

assume:

working directory called d:\#test
files to copy held in d:\#test
location to copy files to is d:\#test\temp
text file with list of filenames is held in d:\#test\test.txt
text file contains:
a.txt
b.txt
x.txt ..etc


--- batch file = run.bat ----------

cd D:\#test
FOR /f %%G IN (D:\#test\test.txt) DO copy %%G D:\#test\temp\


-----------------------------------

this will copy any files listed in test.txt from d:\#test into d:\#test\temp


hth :)


.
 
Last edited:
Thanks :D

actually I've been meaning to get around to the "batch-input-from-file" thing for ages, so you've done me a favour as now I've got a working script too.

.
 
Back
Top Bottom