You might be able to use the search-replace plugin to replace post content but to do that you’ll have to find a way to match those content only so that it doesn’t change anything else.
For example: <a href="https://example.com/this-is-pdf-file-url.pdf" rel="nofollow">....</a>
this is the URL
so you can try to search for .pdf" rel="nofollow
and replace with .pdf" rel="no-idex nofollow
(just example)
You need to find a better way to match things to perform a replacement. and don’t test things on the live website. create a staging website to test things first then do anything on life after taking a full backup.