Help with a rule

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

Moderator: Mr_Noodle

Help with a rule Sat Oct 08, 2022 11:50 am • by jguellec
Hi everyone,

I've been using Hazel for a long time now, usually I manage to create rules on my own but this time I'm having a hard time.. I hope someone will be able to help :)

I want to automatically rename a file with this pattern :
RLV_LCL CJ N° 00558 020434F_20221007.pdf

to something like :
LCLCC-202209.pdf

I've tried different stuff but so far no success...

Anyone could help with the magic formula :P ?

Thanks and have a great day.
jguellec
 
Posts: 5
Joined: Sat Oct 08, 2022 11:42 am

Re: Help with a rule Mon Oct 10, 2022 9:46 am • by Mr_Noodle
Can you describe this transformation? It's not obvious to me as the data in the original filename does not match up with the proposed new one.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Help with a rule Mon Oct 10, 2022 10:26 am • by jguellec
Yes, sure. The original file is an account statement. When I download the file from my bank, it's formatted as followed :

RLV_LCL CJ N° 00558 020434F_20221007.pdf

With :
- RLV_LCL : bank name
- CJ : means "Compte-Joint" (french). It can also be CC
- N° 00558 020434F_ : bank stuff (account number, and blabla. This will never change)
- 20221007 : date of the statement (YYYYMMDD)

I simply want to automatically change the name to something like that : LCLCJ-202209.pdf (month -1)

I must be missing something with the spaces characters and the "N°"...

Thanks for your help, I really appreciate :)
jguellec
 
Posts: 5
Joined: Sat Oct 08, 2022 11:42 am

Re: Help with a rule Mon Oct 10, 2022 10:50 am • by Mr_Noodle
I was a bit confused because in your original example you had LCLCC and 202209, both of which did not match the original file name.

Look up match patterns in the manual. There are chapters there describing how to set up custom attribute to match the parts of the name you want to re-use in a Rename pattern.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Help with a rule Mon Oct 10, 2022 10:57 am • by jguellec
I already tried with this pattern, different things, but still no luck :(

I finally managed to get to the desired result with a "starts with", and in the rename I'm just using the "current date"... I can't get better than that but it's working
jguellec
 
Posts: 5
Joined: Sat Oct 08, 2022 11:42 am

Re: Help with a rule Tue Oct 11, 2022 8:59 am • by Mr_Noodle
If you post your patterns, I can advise from there.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Help with a rule Tue Oct 11, 2022 9:48 am • by jguellec
I tried to upload a screenshot but I don't think I can ?

This is (one of) the pattern I tried :

Extension is : pdf
Name matches : RLV_LCL[...]CJ[...][a][%][...][123][...][ab12]_[Custom Date]

Let me know if I can share a screenshot or if it's not clear. What is between [] are the default patterns available in the App.
jguellec
 
Posts: 5
Joined: Sat Oct 08, 2022 11:42 am

Re: Help with a rule Wed Oct 12, 2022 9:15 am • by Mr_Noodle
You need to use a 3rd party host. If you don't already use some cloud sharing service, you can use imgur.com.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Help with a rule Wed Oct 12, 2022 11:37 am • by jguellec
jguellec
 
Posts: 5
Joined: Sat Oct 08, 2022 11:42 am

Re: Help with a rule Thu Oct 13, 2022 9:32 am • by Mr_Noodle
So you have the date part in a custom attribute. You can use it in a Rename action pattern.

Also, please consult the troubleshooting guide here to help diagnose your rule: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support