Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am doing a mass find and replace using sed and pdftk to find and replace a word in PDF files. When I run the following command,

sed -e "s/word1/word2/g" test.pdf

I get the following error,

sed: RE error: illegal byte sequence

I tried running sed with,

LANG=C sed -e "s/word1/word2/g" test.pdf

and it runs but doesn't find and replace the string.

I should mention that I tried uncompressing the PDF using pdftk, running sed, and then recompressing with no results. I am also running this through MAC OS X bash, but I'm thinking the solution should be relatively the same as Linux command line.

Can anyone offer any suggestions for this?

share|improve this question
    
Have you seen this Web page? stackoverflow.com/questions/220445/… –  MariusMatutiae Sep 29 '13 at 6:19
    
As a side note/question: is this part of a mail-merge project of sorts? –  Michael.M Sep 29 '13 at 6:45
    
This might also be of interest: unix.stackexchange.com/questions/17220/… –  Michael.M Sep 29 '13 at 6:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.