Moving multiple files based on file name

Let's say that I have a bunch of files that all begin with different series' of numbers. I'd like to create a button to move those files into specific, named folders based on what the series of numbers is at the beginning of the file name is. The problem is, that there will be about 300 different possible number sequences, and therefore about 300 different folders. So I can't really create 300 different copy filters.

Example file names:
And so on. In case anyone's curious what these files are, they are recordings from my police scanner, and the first series of numbers are the frequency. The rest is the date and time.

All files beginning with, for example, 154.9050 should be moved to a folder named "State Police," all files beginning with 155.5500 should be moved to a folder named "Bangor PD," etc., etc., for about 300 different frequencies.

Any ideas? Thanks for thinking about it.


Presumably you've got a file which maps the frequences to the directory you need to copy into? e.g.

154.9050 "State Police"
155.5500 "Bangor PD"

You could turn that into a batch file (or big Opus command) which does

move 154.9050_* "State Police"
move 155.5500_* "Bangor PD"

(Maybe with "mkdir" commands before each one to ensure the dir exists.)

You can do that pretty easily with a texteditor that supports macros, as discussed recently in another thread. If you're stuck on how to do it but think the above idea will work, email me the list privately and I'll mail you back the batch file that you can double-click on.


This is an example application of a Script button type you and I were discussing elsewhere.

Hadn't thought of that but yeah, I guess it is.

I don't have a file with the frequencies mapped, but I can make one pretty easily. I was hoping for a DOpus-based solution, but not for any particular reason, just because I was hoping to learn something new about my favorite file manager. :slight_smile:

Thanks for the offer to create the batch file for me. Although I've never done any batch file creation before, this seems like a very simple one. I'll just learn something new about something that's not DOpus. :slight_smile:


You could also make a big Opus button instead of a batch file -- the commands would be virtually identical -- but in this case the only advantage you'd really gain over a batch file, for a one-off use anyway, is nice progress dialogs.

Whichever method you use you'll definitely need a file mapping the frequencies to the names.