I need a script similar to "Find Change From Spreadsheet" but for GREPs.

Explorer ,
May 28, 2022 May 28, 2022

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.

TOPICS
How to , Scripting

Views

91

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , May 28, 2022 May 28, 2022
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

Likes

Translate

Translate
Adobe Community Professional ,
May 28, 2022 May 28, 2022

Copy link to clipboard

Copied

When it does not work, it is not find & replace.

Describe what you are missing.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 28, 2022 May 28, 2022

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 28, 2022 May 28, 2022

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 28, 2022 May 28, 2022

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 28, 2022 May 28, 2022

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 28, 2022 May 28, 2022

Copy link to clipboard

Copied

LATEST

Thanks, that worked perfectly with my document.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 28, 2022 May 28, 2022

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines