Menu
Reply
  • 3.99K
  • 202
  • 893
cybmole
Community elder
344 Views
Message 1 of 11
Flag for a moderator

copy files in name order to usb

way of topic for VM but asking anyway

we just bought a Soveriegn big button USB pleyr for my partially sighted mother in law from RNIB web site, to use for talking books

http://shop.rnib.org.uk/sovereign-usb-memory-stick-player-1.html

had it delivered here to test - in testing I find a flaw- it plays theUSB stick  files in the order that they were copied to the stick - not as per file names.

so If I use windows to copy a folder containing a ~250 files audio book - one file per chapter, - by just drag and drop to the stick ,they play in some random order

if I tediously copy the files one at a time - chapter 1, then chapter 2 ... it is OK

how do I get windows to do this i.e. to copy files from a folder , one at a time, in name order

 there shoudl be some simple dos command / batch file solution ?

 she also uses a commecial audio book loan service - caliber? -we called them & they reckon it will not be an issue with their sticks , as they sell the same player & have no complaints - I plan to test anyway but we will have to travel to gran and borrow a couple

0 Kudos
Reply
  • 2.62K
  • 209
  • 799
Dave_cq
Trouble shooter
333 Views
Message 2 of 11
Flag for a moderator

Re: copy files in name order to usb

This a stab in the dark but I seem to recall that storage formatted as FAT or FAT32 stores files in random order whereas storage formatted as NTFS stores files in Alpha-numeric order.   Memory sticks usually come pre-formatted as Fat 32 so you could experiment with re-formatting it as NTFS and try copying the directory across again.  To reformat, put the stick in the drive and in Windows Explorer ... Right click and select format, then select the NTFS option.

 

********* SuperHub 2ac - Asus rt-ac68u Router - Vivid 100Mbps **********

Electron
0 Kudos
Reply
  • 6.1K
  • 345
  • 1.01K
Superuser
Superuser
323 Views
Message 3 of 11
Flag for a moderator

Re: copy files in name order to usb

Most media devices will not read NTFS formatted usb flash drives. I have run into this problem with DJs who bring USB drives formatted with either NTFS or MAC file system and my Pioneer CDJs refuse to read them. The same goes with many USB capable media devices. They seem to be only able to read the FAT file system. So i would not recommend reformatting them to anything other then FAT32.

As for getting them in order it would depend on how the player reads the files on the usb drive and how it orders them. By the sound of it its reading the date/time on the file and that will be set to the time it was copied over. 


200Mb(SH2 SH2AC Hub 3.0), 2 X V6 TV XL, Phone M. 100Mb Business (Hitron Hub).
0 Kudos
Reply
  • 3.99K
  • 202
  • 893
cybmole
Community elder
316 Views
Message 4 of 11
Flag for a moderator

Re: copy files in name order to usb

you re both right - it's FAT only and FAT dirceoties are not pre-sorted.

google found a freeware utility called FAT sorter - not tested it yet but looks like it will do the trick

http://www.softpedia.com/get/System/File-Management/FAT-Sorter.shtml

0 Kudos
Reply
  • 1.42K
  • 154
  • 457
Superuser
Superuser
304 Views
Message 5 of 11
Flag for a moderator

Re: copy files in name order to usb

for /f "usebackq" %i in (`dir *.<extension> /o:n`) do echo copy %i <destination>

Replace <extension> and <destination> with appropriate entries for your environment. Once you have confirmed the commands generated are correct delete echo

0 Kudos
Reply
  • 3.99K
  • 202
  • 893
cybmole
Community elder
293 Views
Message 6 of 11
Flag for a moderator

Re: copy files in name order to usb

thanks.

can you briefly run talk through how that works please i.e. how it forces the correct ordering

0 Kudos
Reply
  • 1.42K
  • 154
  • 457
Superuser
Superuser
269 Views
Message 7 of 11
Flag for a moderator

Re: copy files in name order to usb

No problem but before doing so it would be useful to know the format of the chapter filenames, for example, Chapter 001.mp3, chapter-001.wav, ….

In addition can you confirm whether the following command lists the filenames in chapter order: dir /b /o:d

0 Kudos
Reply
  • 3.99K
  • 202
  • 893
cybmole
Community elder
257 Views
Message 8 of 11
Flag for a moderator

Re: copy files in name order to usb

the file name format will vary from audio book to audio book but in all cases will appear correctly sorted already in windows folder view- usually the chapter number is at start or end of name. books come from library loans, downloads... and there is no singe common name format . even the library .mp3 ones vary from publisher to publisher. We only use mp3.  Our library is anyway phasing out all its protected .wma audiobooks which saves the hassle of having to strip DRM and convert, for car, phone playback... 

Gran's books mostly come from here. http://www.calibre.org.uk/Library.aspx. They do book groups for care homes etc.. & having looked that up I see they also do streaming. which bypasses the whole name order issue issue if she has internet - will go look into that

if I have used a splitter utility on large mp3 it will have added -001, -002 etc to file name ends. others may be already chapterized with a chapter number somethere in the file name.

 nowadays we don't bother to split. my wife used to have a cd car player ( she has usb now) so we would split books into 5 minute sectors with 5 second overlaps  to help with stopping and starting the car, mid file. a car CD player cant remember where it was within  a file.

 I do have an excellent freeware utility called Bulk Rename Utility - I use it only to get tv shows into proper "Title SnnEnn" format for media servers like plex, but I could use it on any problem book file names also, if ever needed

http://www.bulkrenameutility.co.uk/Main_Intro.php

the RNIB usb player device we just bought will resume exactly where it left off if you turn it off , then on,and allegedly it remembers a bookmark for each different USB stick,

 

 

0 Kudos
Reply
  • 1.42K
  • 154
  • 457
Superuser
Superuser
229 Views
Message 9 of 11
Flag for a moderator

Re: copy files in name order to usb

Thanks for the additional information.

dir book-name-chapter-*.mp3 /b /o:d returns a list of files that match the pattern book-name-chapter followed by any characters with the extension .mp3 in date order. If the list does not match the playlist order then you may be able to use the rename utility mentioned in your post to correct this. With the list correctly ordered the for command can be used to copy the files in playlist order to a device. For example, if the device is mapped / assigned to U: then the command is:

for /f "usebackq" %i in (`dir book-name-chapter-*.mp3 /b /o:d`) do copy %i u:\.

The for loop iterates over the list returned by the dir command executing the copy command against each filename. Note, to see which commands would be executed add @echo after the do in the for command.

 

If the list of files returned by dir book-name-chapter-*.mp3 /b /o:d is incorrectly ordered then iterate over a range instead; note for this to work chapter numbers should not be zero padded.

for /l %i in (1,1,20) do copy book-name-chapter-%i.mp3 u:\.

The for loop iterates through the range 1, in increments of 1, to 20. Note, to see which commands would be executed add @echo after the do in the for command.

0 Kudos
Reply
  • 3.99K
  • 202
  • 893
cybmole
Community elder
209 Views
Message 10 of 11
Flag for a moderator

Re: copy files in name order to usb

ok - i follow that, thanks. but it's not date order that's needed, it's alphabetical order.

do you know of any dos for dummies style web pages & I can look more closely at command options & take it from here

 I have a smattering of dos but I have not used the for command before. 

 the lazy way will be to use the fat sorter utility but I like to learn  new tricks now & again; but there has to be an actual need to motivate me

( e.g. I learned enough html & lots of  CSS to be able to tweak my epub ebooks formatting)

0 Kudos
Reply