Page 1 of 1

Extracting a text value from the contents of a PDF

PostPosted: Fri Apr 16, 2021 10:38 am
by waxwing
I've searched but don't seem to be asking the question properly. I am able to extract the date from a file and I can search a file for a particular word and rename the file with that word. This seems different, though.

I will be getting dozens of Explanation of Benefits and After Visit Summaries over the next year due to a family medical situation. The After Visit Summaries all have text that shows something like:

Today's Visit
You saw CARRIE PETERSON MD on Monday, April 5, 2021.

The doctor or department name is always in all caps but it will change depending on who we saw that day. Is there a way for me to grab that text using Hazel so I could end up with a file name like:

2021-04-05 AVS CARRIE PETERSON MD

(I know how to do the date work. I don't want to create a rule for each of the dozens of providers, labs, docs, departments, we'll be seeing.)

Thanks for any tips!

Re: Extracting a text value from the contents of a PDF

PostPosted: Mon Apr 19, 2021 9:38 am
by Mr_Noodle
Use a match pattern with a custom text attribute, instead of a date. The pattern could be something like:
Code: Select all
You saw (• doctor name) on (◦ visit date)

where (• doctor name) is a custom text attribute set to match "anything".