Extract data from PDF

I use Hazel to find a date in my payslip and use that data to rename and file the payslip. That works well.

What I’d like to also do is search in that PDF and extract my hours worked and paste that number into a spreadsheet. Is that possible? Thank you in advance.

Theoretically possible, yes. Depends on you identifying the text pattern you need to use search for the relevant text, and make it relatively bullet-proof to make the effort to automate worth it to you. As it’s a payslip which I assume is monthly, then maybe first simpler step would be use open the PDF in Preview and select the info and then copy/paste into a spreadsheet, then edit out the stuff that creeps in that is of no value.

Unless you really need to actually paste (which is doable with AppleScript in Numbers or Excel) & need spreadsheet features, I’d recommend keeping the output in a csv file. Plain text is going to be less work.

1 Like

Thanks for the replies. In the end I went through all the PDFs manually. I’m paid fortnightly so for 2.5 years worth of payslips it took a while.