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?
1 Answer
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'.
-
13I 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.– ÁngelJan 6, 2018 at 23:00
-
2Also put the unique appending text at the beginning and end of the word to avoid the above stated issue.– XonatronJan 7, 2018 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 :)– RuslanJan 7, 2018 at 16:58
-
1and 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.– dlatikayJan 7, 2018 at 20:00