Skip to main content
Participant
July 5, 2024
Question

Replace contractions using FindChangeByList

  • July 5, 2024
  • 4 replies
  • 509 views

I'm trying to replace contractions in a book I'm editing using the FindChangeByList script. Replacing words like 'I am' to 'I'm', 'It is' to 'It's' etc.

 

I tried editing the txt file the script uses and adding the following command - 

 

text {find what:"I am"} {change to:"I'm"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find all I am and replace with I'm.

 

But it isn't working. What am I doing wrong here? (Attaching a screenshot)

This topic has been closed for replies.

4 replies

Peter Kahrel
Community Expert
Community Expert
July 5, 2024

Yet another possibility is that the space in I am isn't a plain space but e.g. a non-breaking one. To get around that, use a GREP replacement rather than a Text replacement, using a catch-all for the space:

 

grep {find what:"I\\ham"}

 

where \h stands for 'horizontal space', that is, any space.

 

Robert at ID-Tasker
Legend
July 5, 2024

@Raag25804015f4fk

 

I think you need to ESCape the apostrophe:

 

"I\'m"

 

Stefan Rakete
Inspiring
July 5, 2024

text {find what:"I am"} {change to:"I'm"} works for me. Make sure that there is a tabulator between items of a line in the FindChangeList.txt. I always copy a line FindChangeList.txt and modify it.

Community Expert
July 5, 2024

Thanks for confirming my findings too - and ensuring it's tabs/tabulated instead of spaces.

Community Expert
July 5, 2024
quote

text {find what:"I am"} {change to:"I'm"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}


By @Raag25804015f4fk

Do you have each section separated by a tab character?

It's tab delimited I think, make sure there's no spaces.

Community Expert
July 5, 2024
text    {find what:"I am"}    {change to:"I'm"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}