Extracting Text as variables for renaming files?

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

Moderator: Mr_Noodle

Hello,

I'm working on a solution to automate sorting of faxes coming into a physicians office. I've made a fair bit of progress using PDFpen to OCR the files received and sorting them into sub-folders based upon keywords, which works very nicely.

The next step is renaming the files. Ideally, I'd like to search the documents for fields such as "Patient Name:" and then take the next couple words and attempt to rename the file..

ie -- "CONSULT-20151206-154122.pdf" becomes "CONSULT-Doe, John 1.pdf".

Is this possible with Hazel? Anybody have any suggestions or tips to help me out?! :)

Thanks in advance,
- Tim
trowe
 
Posts: 1
Joined: Mon Dec 07, 2015 4:35 pm

Use "Contents contain match" to search the contents of the files. Search the help for "match patterns" to get up to speed on specifying patterns. You'll want to search for "Patient Name:" and then use a custom attribute to capture the text after it. If you run into any specific issues, report back here.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support