Skip to main content
MrAlexander
Participant
January 22, 2024
Question

Find & Replace a set of string across multiple files

  • January 22, 2024
  • 1 reply
  • 318 views

I receive a set of PDFs every week that i need to update.

 

For each PDF i have 2 sets of strings that need to be found and replaced.

 

Set 1 :

A => 123

B => 456

C => 789

 

Set 2

A => 987

B => 654

C => 321

 

I could this manually but the issue is that I have new files coming in every week and the replacements are all the same, i have about 20 strings to replace per set and I would like to automate this as much as possible.

 

How can I perform this action without having to do this tedious one by one ?

 

Could JavaScript assist ? anything else ?

 

Thanks for your help, hoping to find the answers !

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
January 22, 2024

JS can be used to overlay the new text over the old one (and even to redact the old text, if you need to have it completely gone), but that won't "reflow" the page's contents, so if the new text is longer than the old one, or if there's a background color behind it, the result won't look good, and it might even remove other text by accident.