Replace part (but not all) of a filename with a folder name?

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

Moderator: Mr_Noodle

Hi,
I'm new to Hazel and I'd like to replace part (but not all) of a filename with a folder name? For new projects I have a template with many files that have the word "generic" in the filename. Currently, I manually rename each of these by copying and pasting the folder name - like this:

Folder Name: Project A

Files in Project A folder:
generic - word.doc
generic - spreadsheet.xls
generic - proposal.doc

I now manually rename these files to look like this:
Project A - word.doc
Project A - spreadsheet.xls
Project A - proposal.doc

How do I use Hazel to do this for me when I apply rule to the Project A folder? I've been able to rename files, but that wipes out the entire file name and I get something like this:

Project A.doc
Project A-1.xls
Project A-2.doc

What am I missing? I think it involves replace text (replacing "generic" with "Project A"), but I can't work out how to do it.

Any ideas?
jake s
 
Posts: 1
Joined: Thu Jul 28, 2016 2:37 pm

I believe we spoke in email earlier. Please try and go through my tips I sent. In particular, check the help article on match patterns as that will go over the basics of how to rename while using previous parts of the filename.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hi @Mr_Noodle and all,

I would be very much interested in the answer to this one as well. While I face basically the same issue, I want to replace a suffix such as "FILENAME(to_replace).mp3".

If you would be so kind to send me those info too that I can apply in Hazel 5?!

Thanks. 8)
Rosa
rosaballons
 
Posts: 1
Joined: Wed May 26, 2021 3:55 am

Can you describe your specific case in more detail?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron