Extracting certain files from a directory

Closed
Brian - Apr 29, 2010 at 12:18 PM
sharpman Posts 1021 Registration date Saturday May 23, 2009 Status Contributor Last seen October 20, 2010 - Apr 29, 2010 at 04:44 PM


I have a .csv file containing the filepaths of selected mp3 files - these all come from the same directory. I wish these files (approx. 8000 of a complete directory of around 15,000) to be copied into a new folder. Rather than manually going through the 15,000 files to find the 8000 I want and copying, could I somehow use the .csv file to do the transfer in one go?

I hope this is clear!

many thanks
bw

3 replies

sharpman Posts 1021 Registration date Saturday May 23, 2009 Status Contributor Last seen October 20, 2010 183
Apr 29, 2010 at 01:19 PM
you can create a batch file (created in notepad and saved as .bat)

please copy the relevant .csv file here, or an example of what you have.
i'll have a look and try to offer you a solution.
0
I have a .csv file containing entries such as:

G:\DATABASE\song1.mp3
G:\DATABASE\song67.mp3
G:\DATABASE\song1678.mp3

etc

where the DATABASE directory contains 15,000 or so files.

Can I extract the selected ones (as noted in the .csv file) to a separate directory.

Many thanks
0
sharpman Posts 1021 Registration date Saturday May 23, 2009 Status Contributor Last seen October 20, 2010 183
Apr 29, 2010 at 04:44 PM
https://www.computerhope.com/xcopyhlp.htm

ok, here's what we have ....

G:\DATABASE\song1.mp3
G:\DATABASE\song67.mp3
G:\DATABASE\song1678.mp3


Using your .CSV file add some text in front of each file you want to add the following text.

copy G:\database\song1.mp3 G:\newdirectory\

add the text in bold to each file name that you wish to copy over to the new directory. (you need to create the directory first. so the G:\newdatabase part will be the location of the directory that you have created.)

Save as your CSV file with a .bat at the end of the file for example SongMove.bat

Save this file in a place you can remember easily.

the file icon will show as a little blue dos box with a yellow cog in it.

Now there are a few rules to remember.

no spaces in song file names. it won't like them.
no space in your saved .bat file name.

when all done, all you need to do is double click on your new bat file and it will proceed to find and copy the song files requested to your new directory.

hope this works for you. please let me know if all is ok. if not get back with the resulting issue and see where to go.
0