Page 1 of 1

Rename PDF with found text that has variable length

PostPosted: Sun Jun 14, 2020 1:31 pm
by squashray
We receive PDF reports that have consistent text: (* varies by report)

File name is always: L*********
Always contains: Accession: L*********
Always contains: Rcvd: DD-MMM-YYYY

Always contains: FIRSTNAME LASTNAME (Always capitals,But variable length for each)
Is there a way to pull this information out of the file to auto rename as:

Labwork-FIRSTNAME-LASTNAME-DD-MMM-YYYY

Not sure how to find/Match/set token to text that varies in length.

Thanks

Re: Rename PDF with found text that has variable length

PostPosted: Mon Jun 15, 2020 10:23 am
by Mr_Noodle
Can you give more concrete examples of what **** can be and how it looks in context?

Re: Rename PDF with found text that has variable length

PostPosted: Mon Jun 15, 2020 11:04 am
by squashray
Mr_Noodle wrote:Can you give more concrete examples of what **** can be and how it looks in context?



A filename and accession number example would be:
L200610307

It is always 9 numbers
All of the text I indicated in the first post is consistently identified as editable text in Preview/PDFPen/Expert/Adobe etc so it should be searchable.

I have a screen grab of the top of the PDF layout - but how do I show that here ?.?.?

Re: Rename PDF with found text that has variable length

PostPosted: Tue Jun 16, 2020 10:35 am
by Mr_Noodle
You'll need to upload the screenshot to a file sharing or image hosting service. If you don't have one you use already, try imgur.com.

If it's always a number and comes after "L", you can do "L(number)". How does it look in the preview?

Re: Rename PDF with found text that has variable length

PostPosted: Wed Jun 17, 2020 10:58 am
by squashray
Mr_Noodle wrote:You'll need to upload the screenshot to a file sharing or image hosting service. If you don't have one you use already, try imgur.com.

If it's always a number and comes after "L", you can do "L(number)". How does it look in the preview?


Thanks. Here is the link:
[Imgur](https://i.imgur.com/X0bQ5L1.png)


Just so no confusion - I'm unclear how to grab the name text for use as a naming token when it can be different lengths.
ie JOE SMITH
ie SPARKY NOODLESOFT

Re: Rename PDF with found text that has variable length

PostPosted: Thu Jun 18, 2020 10:33 am
by Mr_Noodle
You can use a pattern like: "Patient: (•firstname) (•lastname)" where the two custom tokens are set to match a word. This may not work for people that have multi-word names so you will have to play with it.