I am currently searching in vain for a way to use hazel to eleminate part of the filename when renaming.
I have already searched in the forum and also consulted the manual (e.g. Using Match Patterns in Conditions and following articles). Unfortunately without having found a solution.
About the background:
I scan my documents with ExactScan Pro or download them from the Internet into a folder monitored by DEVONthink, there the OCR is performed. From there it is moved to three folders monitored by Hazel.
When scanning (as well as downloading) I use a barcode to retrieve and sort the documents according to the following scheme:
- Code: Select all
_year-sequential-no.-MC => _2022-0103-MC
I can filter this barcode with
- Code: Select all
name - matches - .... Barcode (1111-1111-aa)
When downloading invoices (e.g. from Amazon, Apple etc.) I rename many documents already when saving them, these then go through the normal workflow.
The invoices then look like this, with the item always being different:
supplier_ invoice_2022-07-29_ article_Barcode
Before sorting the downloaded files into Cloud Drive/DEVONthink, I would like to remove this barcode from the file name. The rest should be kept, so:
supplier_ invoice_2022-07-29_ article
How can I realize this?
I have already tried it with Replace Text... at Name. But that doesn't work somehow, probably because of the placeholders.
Replace: _20*-*-MC with empty
How do I have to change this or which placeholders do I have to use to make it work? I have not found anything in the manual.
I get rid of the -MC, but how do I do that with the sequence number, which is different in each file.
And the year should also be flexible, so that I don't have to tackle every rule again the next year.
Many greetings
Markus