Page 1 of 1

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

PostPosted: Thu Jul 28, 2016 3:09 pm
by jake s
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?

Re: Replace part (but not all) of a filename with a folder n

PostPosted: Thu Jul 28, 2016 4:30 pm
by Mr_Noodle
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.

Re: Replace part (but not all) of a filename with a folder n

PostPosted: Wed May 26, 2021 4:00 am
by rosaballons
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

Re: Replace part (but not all) of a filename with a folder n

PostPosted: Wed May 26, 2021 9:45 am
by Mr_Noodle
Can you describe your specific case in more detail?