Using part from the file name for renaming does not work

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

Moderator: Mr_Noodle

Good evening from Germany,

I want to use the barcode (S_2020-0187-MC) that I write into the file name with ExactScan Pro within the OCR process (this is what a file name looks like after scanning: Scan-001_2020-11-22_14|14|35_S_2020-0187-MC.pdf) when renaming the file in the 2nd part.

With a hazel rule "Name matches ... S _ 123 - 123 - MC" I read the barcode from this file name. Without "Anything ..." an error message will be displayed.

Unfortunately the screenshots do not work differently than with Dropbox
https://www.dropbox.com/s/fbocn0equ9ieqos/Name%20matches.png?dl=0

This works also so far. But if I want to rename the file in the second part of Hazel, the complete original file name is used for renaming.

I need a hint how to rename only the last part from "S_" on.

https://www.dropbox.com/s/qzr2drn9wclk4at/File%20Name.png?dl=0

I have already looked in the options, but with TextFotmat or Replace Text I did not get it right.

https://www.dropbox.com/s/1arvjpnoihv8mei/Rename.png?dl=0

What other options are there?

Thanks for the tips
Markus
AbwehrchefVC
 
Posts: 17
Joined: Sun Jan 08, 2017 9:46 am

Do not include everything in your •Barcode custom attribute. Only match the parts you want to use later. Leave the other parts outside of that.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Do not include everything in your •Barcode custom attribute. Only match the parts you want to use later. Leave the other parts outside of that.


that was my plan, but that's the problem:

I created the attribute "Barcode" as custom text

When I
<Anything…>S_<123>-<123>-MC
the green check mark appears

But if I
S_<123>-<123>-MC
then this is acknowledged with the red cross

This is what the file name looks like:
Lippische_Rechnung_2020-01-01 Kfz-Versicherung_S_2020-0026-MC

So it should actually be recognized :roll:

If there is still the possibility to copy only the rear part "S_2020-0026-MC" into the file name
AbwehrchefVC
 
Posts: 17
Joined: Sun Jan 08, 2017 9:46 am

The behavior with

Name -> matches

seems to be a different one than if I would have done it with

Contents -> contain match

do.

Because with account Kontoauszug Nr.<Anything...><123> it works wonderfully and only this expression is taken over
AbwehrchefVC
 
Posts: 17
Joined: Sun Jan 08, 2017 9:46 am

With "matches", your pattern has to account for all of the text. You can just specify a pattern for part of the text. You can use "anything" if it doesn't matter what the text is outside of the part you care about but it's better to be as specific as possible as you may end up matching a different part of the text than you intended.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support