Copy link to clipboard
Copied
Hi
I have a problem with a GREP: when I do it one by one it works perfectly, but when I use Change all command it doesn't work, so I need a script to do the find and change one by one to the whole file, so it's something similar to Find Change From Spreadsheetbut with GREP instead of text.
Hi @AK09M, try this:
((?<=~F) | (?=~F))
This searches for a space with a footnote number before it OR a space with a footnote number after it.
- Mark
Copy link to clipboard
Copied
When it does not work, it is not find & replace.
Describe what you are missing.
Copy link to clipboard
Copied
I have a space before and after every footnote number in the text and I want to remove them, I used
Find: (~F)
Change to: $1
When I do it one by one it works perfectly, but when I use change all it doesn't work it turns them into squares.
see the link below for a sample of the file.
Copy link to clipboard
Copied
Hi @AK09M, can you give an example of your GREP that works for one change but not for change all? I've never come across that before and I'd like to understand what happens.
- Mark
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi @AK09M, try this:
((?<=~F) | (?=~F))
This searches for a space with a footnote number before it OR a space with a footnote number after it.
- Mark
Copy link to clipboard
Copied
Thanks, that worked perfectly with my document.
Copy link to clipboard
Copied
I tested your grep and had similar results to you. Thank you—that's an interesting edge case.
My guess is that because the footnote numbers are special objects, of which only a part is the text representation in the story, that when the grep engine picks one up and puts it back down as $1 it is messed up. My approach is to only focus on the spaces, not the footnote number.
- Mark