21

I have a very long file which refers certain persons as Petitioners and certain persons as Respondents. I want to swap these two words so that the Petitioner is changed to Respondent, and vice versa. Can this be done automatically?

48

Use a third word that does not occur in your text. e.g.

  • change (find and replace) all 'Petitioner' to 'PetitionerXX',
  • then change all 'Respondent' to 'Petitioner',
  • and finally change all 'PetitionerXX' to 'Respondent'.
| improve this answer | |
  • 12
    I would use something even more unique than appending a couple of XX, eg. "[QWERTYIUIO]". And always review the changes performed. Sometimes unexpected words arise. If you were changing "petition" to "response", you wouldn't want the petitioner to become the responseer. Whereas you probably do want petitioners to become repondents. – Ángel Jan 6 '18 at 23:00
  • 2
    Also put the unique appending text at the beginning and end of the word to avoid the above stated issue. – Xonatron Jan 7 '18 at 1:40
  • 1
    @Ángel if one feels really paranoid, it's a good idea to generate a one-time-use UUID as something truly unique :) – Ruslan Jan 7 '18 at 16:58
  • and use the "match whole word" and "case sensitive" options carefully. Furthermore, there may be multiple grammatical cases that need to be considered: Petitioners, petitioner's, petitioners', petitioner, hyphenated compounds like "petitioner-caused" etc. Some versions of Word have a tick box for this in the replace dialog, I've no idea how sophisticated that is. – dlatikay Jan 7 '18 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.