Renaming PDFs based on specific phrases in the text body

Javascript renaming examples. Javascript renaming is supported in version 3 or newer.

Renaming PDFs based on specific phrases in the text body

Postby VtheMech » Thu Sep 22, 2016 4:41 pm

I scan a lot of court notices and then OCR them. Is there a way to search the pdfs for specific phrases/strings and then rename them based on what's found inside? I don't want it named exactly like the string though.

For example, a notice might contain "NOTICE OF INITIAL HEARING" - I want to rename it "Notice- Initial Hearing"
and another might be "NOTICE TO THE PLAINTIFF: RENEWAL(SUMMONS)" - I want to rename it "Notice- Summons Reissued"

I want like 10 to 15 searches in 1 script.

Is this doable?
VtheMech
 
Posts: 3
Joined: Thu Sep 22, 2016 4:17 pm

Re: Renaming PDFs based on specific phrases in the text body

Postby therube » Fri Sep 23, 2016 2:45 am

Similar too...
Suppose you could create a batch file & send the video files to ffprobe, filtering its results, sending that filtered data to a text file, generating a "Rename-pair" that you'd import into BRU (but that would seem to be a somewhat convoluted process)?
viewtopic.php?f=4&t=3144


for i in courtnotices do
grep %i "initial hearing"
if true, echo %1 >> initialhearing.TXT
grep %i "renewal summons"
if true, echo %1 >> renewalsummons.TXT
...

then massage those .TXT files so that they're meaningful when imported as a Rename-pair.


And anything along those lines has to assume that your OCR is "accurate"...
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: Renaming PDFs based on specific phrases in the text body

Postby VtheMech » Fri Sep 23, 2016 2:36 pm

Thanks for the reply.
VtheMech
 
Posts: 3
Joined: Thu Sep 22, 2016 4:17 pm

Re: Renaming PDFs based on specific phrases in the text body

Postby JoshRanch » Fri Oct 06, 2017 3:50 pm

I have a similar inquiry however i want to rename the file with exactly the text in the body. How is this done?
JoshRanch
 
Posts: 3
Joined: Fri Oct 06, 2017 3:45 pm


Return to Javascript Renaming