Rename PDF based on REGEX value inside the file

Bulk Rename Utility How-To's

Rename PDF based on REGEX value inside the file

Postby grishmabeli6 » Wed Jul 22, 2020 4:40 pm

Hello, I have thousands of .pdf files, all of them have a value that I can easy find by using a regex within the first few lines of the file. The regex value is the member number of each record, is there a way to batch rename all these .pdf based on that number inside the file.
grishmabeli6
 
Posts: 1
Joined: Wed Jul 22, 2020 4:32 pm

Re: Rename PDF based on REGEX value inside the file

Postby therube » Wed Jul 22, 2020 4:55 pm

With BRU, generally, no.

With BRU & JavaScript, perhaps, but I wouldn't know about that.


Though you might be able to script something?
Set up a loop to go through your .pdf
Grep (search) them (presumably something keyword within each file pointing to your wanted value), searching for this "value" within
Parse that found value to get only the part you want, your "value"
Rename the file REN filename filename+value
Loop:
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm


Return to How-To


cron