Is it possible to "batch" copy files in specific order?

mbg10484

Distinguished
Jul 3, 2010
27
0
18,530
Say I have 200 folders with 20 files each in them. In each folder the 20 files are named 1-20 (1.mp3, 2.mp3, 3.mp3, etc.) I need all these files to be copied in alphanumeric order meaning folder 1 will be copied to the USB drive before folder 2, and within each folder, file 1 will be copied before file 2.

If I just select all the folders and drag them to the USB drive to copy, windows copies them in a seemingly random order.

So far, the only way I've been able to accomplish this is to copy each file individually one by one. With thousands of files this would take forever.
 
Solution
Not sure why you need to do this sequentially, but try the following command from a command window:

dir /b /s *.mp3 > songlist.txt

This writes the output for the directory command (including sub-folders and their contents) to the text file songlist.txt.

From there you can copy the contents to a word processor and/or spreadsheet to edit it to your liking using global find and replace and create a sequential copy command batch file.

-Wolf sends

Reyaz123

Admirable
Not sure if this answers your question.

Drag all of those files into your usb drive. When it is done copying over
Open the usb drive folder in your computer
Click at the top "Name" once or twice (it is near the date modified, type, size)
It will sort it by numeric values
 

Wolfshadw

Titan
Moderator
Not sure why you need to do this sequentially, but try the following command from a command window:

dir /b /s *.mp3 > songlist.txt

This writes the output for the directory command (including sub-folders and their contents) to the text file songlist.txt.

From there you can copy the contents to a word processor and/or spreadsheet to edit it to your liking using global find and replace and create a sequential copy command batch file.

-Wolf sends
 
Solution

mbg10484

Distinguished
Jul 3, 2010
27
0
18,530



Thanks, I'll have to give it a try. The reason I want this to be sequential, is because this is for use with my car stereo. Thanks to the short sightedness and/or stupidity of the people who wrote the firmware for the deck I have, there is no way to reorder the files. When browsing through the files (songs) on the stereo, they appear (and more importantly playback) in the order in which they were written to the USB drive. About 95% of my entire music collection is full albums, and I like all the songs to be in the proper order, just like if you were to pop in the physical CD.

BTW I have no experience creating batch files. Any chance you could point me in the direction of a good tutorial on how I'd go about creating a sequential copy command batch file?
 

Wolfshadw

Titan
Moderator
Creating a batch file is easy. Open notpad, type in a DOS command, and save the file with a .bat extension. Viola! you have a batch file. In your case, the batch file would first create the folder structure:

Code:
mkdir F:\1
mkdir F:\2
.
.
.
mkdir F:\200

Then you'd start copying files over

Code:
copy d:\mp3\1\1.mp3 F:\1\1.mp3
copy d:\mp3\1\2.mp3 F:\1\2.mp3
.
.
.
copy d:\mp3\200\20.mp3 F:\200\20.mp3

Once all this is typed into notepad, click the File --> Save As... menu option.
Enter a file name that ends in ".bat", like "songlist.bat"
Change the "Save As Type..." option to All Files.
Click the Save button.

Now 20,000 line of code may be a bit much to write, but there are shortcuts you can use if you're familiar with Excel and Word (or similar products).

Of course, before you go through all of the hullabaloo, have you made sure your mp3 player simply is not in "Shuffle Mode"?

-Wolf sends

 

mbg10484

Distinguished
Jul 3, 2010
27
0
18,530


Thanks again. I wish being on shuffle was all that it was.