check filename pattern

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

Moderator: Mr_Noodle

check filename pattern Mon Jan 13, 2014 6:44 pm • by snewpers
Hi again,

is it possible to create a ruleset based on a filename pattern?

What I have is filenames in this pattern: N12345678_ABCDEFG_1

Where, 'N' is a Single letter,
'123' is a range of exactly 8 digits followed by an underscore,
'ABC' is a name no longer than 9 letters followed by an underscore,
and '1' is a a single digit.

I want the rule to work on that folder ONLY if it is a perfect match, like 'D98765432_FILENAME_4'.
I have part of it working, but the 'ABC' range is something I don't know how to fix. There's no range token to be set, or should I create and 'ANY' nested rule re-use the same rule 8 times, increasing by 1 letter each time?

Thanks!
snewpers
 
Posts: 5
Joined: Wed Jan 01, 2014 1:10 pm

Re: check filename pattern Tue Jan 14, 2014 4:25 pm • by Mr_Noodle
I assume you are using Hazel's match patterns? If so, can't you just represent that as 9 separate letter tokens?
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: check filename pattern Wed Jan 15, 2014 2:18 am • by snewpers
Hi

Yes, I'm using match patterns. I could use 9 letter tokens, like I did with the 8 digits, but, it's a range from 1-9 letters and possibly some special characters like an dash or underscore.
snewpers
 
Posts: 5
Joined: Wed Jan 01, 2014 1:10 pm

Re: check filename pattern Thu Jan 16, 2014 4:18 pm • by Mr_Noodle
Ah, I see. Do you have to be that strict? Could you just use the "anything" token? If you specify the _ afterwards, it should properly bound the text.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support