Extract data from file to rename file

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

Moderator: Mr_Noodle

Extract data from file to rename file Mon May 22, 2023 9:29 pm • by joeygator
I have attached an image from a section of a PDF that I would like to pull part of this label to rename the file.

Look at the image, in the example, I am trying to extract the data "UCF Basketball" along with the event date to rename the file "2023-02-22 UCF Basketball.pdf"

I have it grabbing the event date but I have not clue how to get the rest of it in to the rename process. Any suggestions would be great!
joeygator
 
Posts: 6
Joined: Mon May 22, 2023 9:24 pm

Re: Extract data from file to rename file Tue May 23, 2023 9:42 am • by Mr_Noodle
Not seeing any image. Can you post a screenshot of your rule? Note that you can't upload screenshots directly here. Use a third party hosting service like imgur.com
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Extract data from file to rename file Tue May 23, 2023 11:33 am • by joeygator
I’m not sure how to set the rule. I had to wait for this post to be approved since I am new. I will have to figure out where to host. It is a name of an event in a pdf. It is preceded by “Event:” and a few spaces. Not sure how to randomly select text. I thought maybe the “Event:” could be the identifier of the text immediately following but I have no idea if that can be done.
joeygator
 
Posts: 6
Joined: Mon May 22, 2023 9:24 pm

Re: Extract data from file to rename file Tue May 23, 2023 11:37 am • by joeygator
This is the link that should work to view the screen shot if the text I am trying to grab.

https://www.dropbox.com/s/2yop797hs14hy ... 1.png?dl=0
joeygator
 
Posts: 6
Joined: Mon May 22, 2023 9:24 pm

Re: Extract data from file to rename file Wed May 24, 2023 8:59 am • by Mr_Noodle
Can I see the rule you have so far?
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Extract data from file to rename file Thu May 25, 2023 5:57 pm • by joeygator
Here is a link to the rule screenshot:

https://www.dropbox.com/s/tq0jmnpjbll5e ... M.png?dl=0
joeygator
 
Posts: 6
Joined: Mon May 22, 2023 9:24 pm

Re: Extract data from file to rename file Fri May 26, 2023 8:48 am • by Mr_Noodle
Try using a custom text attribute after "Event: " in your pattern.

BTW, what version of Hazel and macOS are you running? I'm wondering about the vertical alignment mismatches in the pattern fields.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Extract data from file to rename file Thu Jun 01, 2023 11:19 pm • by joeygator
I am using Hazel 5.1 and Ventura 13.4.

I have no idea what Custom Text Attributes is. Can you provide a link where I can maybe learn about this?

Thank you for the assistance!
joeygator
 
Posts: 6
Joined: Mon May 22, 2023 9:24 pm

Re: Extract data from file to rename file Thu Jun 01, 2023 11:20 pm • by joeygator
Also, the form I am scanning and pulling the event name out of is designed by me. I could redo the layout and put the name somewhere specific like the first line of the document. If something like that would make this easier I could work my way thru my existing documents and change the layout to make it automatic going forward. Thanks again!
joeygator
 
Posts: 6
Joined: Mon May 22, 2023 9:24 pm

Re: Extract data from file to rename file Fri Jun 02, 2023 9:12 am • by Mr_Noodle
Look up match patterns and custom attributes in the manual. There's a full discussion there.

Also, I highly recommend updating to 5.2.2. Note that the in-app updater may be broken in which case I suggest downloading and installing the update manually.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron