Sorting similarly named files

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Sorting similarly named files Wed Sep 18, 2019 5:26 pm • by mario
Hello,

I'm sorry if this seems simple, but I'm having trouble figuring it out;

I output batches of audio files that have similar names when I export songs for mix. When I'm working on a movie, all files/stems start with the same file name, for example:

SSS_01.01-first_song-woodwinds
SSS_01.01-first_song-brass
SSS_02.01-second_song-woodwinds
SSS_02.01-second_song-brass
etc

The first three characters are the movie title, the next set on numbers is the song number, and the final set of numbers is the revision version. As I output more revisions, my folder fills up with version revisions;

SSS_01.01-first_song-woodwinds
SSS_01.01-first_song-brass
SSS_01.02-first_song-woodwinds
SSS_01.02-first_song-brass
SSS_01.03-first_song-woodwinds
SSS_01.03-first_song-brass
etc

I would like to use Hazel to move previous revisions to a sub folder and leave the current revision in place. Any advice would be greatly appreciated!

Thank you!
mario
 
Posts: 2
Joined: Wed Sep 18, 2019 5:05 pm

Re: Sorting similarly named files Thu Sep 19, 2019 10:33 am • by Mr_Noodle
First off, look up "match patterns" in the help as that is the basic mechanism you are going to use. You would create custom attributes for each of those parts (or at least the revision number).

Now that you have the revision number in a custom attribute, you can use it in a condition. For instance, "(•revision number) is not among the 1 highest" will match any file that doesn't have the highest revision number in that folder. You can then use Sort into subfolder for those files.
Mr_Noodle
Site Admin
 
Posts: 8697
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Sorting similarly named files Wed Aug 05, 2020 5:22 am • by mario
I never did get this working and I'm circling back to it again...

I wasn't able to find a custom attribute that would give me the "is among the X highest" option. The closest I got was using the Custom Date attribute, (gave me "is among" etc), but I'm sure that's wrong. Custom Text gave different options, (is / is not, contains / does not contain, etc).

My current pattern is:
"CF_",123,.,•revision,a1%,abc,a1%,…

The pattern rule matches the file names below. I just need to have the custom attribute "•revision" give me the correct options when I use it in a condition.

and the files I'm trying to sort are:
CF_02.02-present_judge-STEM Sparkle Keys.wav
CF_02.01-present_judge-STEM Sparkle Keys.wav
mario
 
Posts: 2
Joined: Wed Sep 18, 2019 5:05 pm

Re: Sorting similarly named files Wed Aug 05, 2020 10:39 am • by Mr_Noodle
Sorry about that. I forgot that text attributes don't have any notion of ordering since they are arbitrary text. I'd need to add a custom number attribute feature that would know that it's a number and provide options accordingly. In the meantime, though, you would need to use a script of some sort to do this.
Mr_Noodle
Site Admin
 
Posts: 8697
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support