GREPping digits

51 views
Skip to first unread message

Ann_Camilla

unread,
Aug 14, 2013, 10:00:41 AM8/14/13
to indesi...@googlegroups.com
I'm a complete novice where GREP is concerned. I have this book to do, about 600 pages and each page has half a dozen footnotes. For some reason InDesign wouldn't bring the footnotes in although I've rootled around in the Word document and can't understand why. I saved the Word doc as RTF. No footnotes at all. So I saved it as .docx and voilà, footnotes. 

But there's a very large 'but': in the text, InDesign has inserted the footnote number inside the existing footnote number. So, for instance, instead of having footnote (superscripted) 21, I have 2211. And so on.

So I thought this was a job for GREP -- simple (I wish!). Find: \d(\d\d)\d -- Change to: $1 -- Find Format: Footnote Reference

Well this can't be found apparently. I want to find these numbers and delete the first and 4th digit. That's all. Why won't InDesign help here?

Ann

William Adams

unread,
Aug 14, 2013, 10:09:23 AM8/14/13
to indesi...@googlegroups.com
The superscripted footnote number doesn't register as digit(s), it's a ``Footnote marker'' --- instead use something like:

\d*~F\d*

but you can't (IME) replace the footnote back using GREP, so instead, you should assign a formatting which isn't used in the document to the digits and the footnote marker, then search for digits w/ that formatting and replace w/ nothing (and no formatting) deleting only the digits, leaving the footnote marker.

William

--
William Adams
senior graphic designer
Fry Communications
Sphinx of black quartz, judge my vow.

Ann_Camilla

unread,
Aug 14, 2013, 10:24:11 AM8/14/13
to indesi...@googlegroups.com
Many thanks for this insight, William.
Ann

Rick Gordon

unread,
Aug 15, 2013, 3:48:06 AM8/15/13
to indesi...@googlegroups.com

What about:

FIND: \d+(~F)\d+
CHANGE TO: $1

Rick Gordon

------------------

On 8/14/13 at 10:09 AM -0400, William Adams wrote in a message entitled
"Re: [ID] GREPping digits":

>On Aug 14, 2013, at 10:00 AM, Ann_Camilla wrote:
>
>> I'm a complete novice where GREP is concerned. I have this book to do, about 600 pages and each page has half a dozen footnotes. For some reason InDesign wouldn't bring the footnotes in although I've rootled around in the Word document and can't understand why. I saved the Word doc as RTF. No footnotes at all. So I saved it as .docx and voil�, footnotes.
>>
>> But there's a very large 'but': in the text, InDesign has inserted the footnote number inside the existing footnote number. So, for instance, instead of having footnote (superscripted) 21, I have 2211. And so on.
>>
>> So I thought this was a job for GREP -- simple (I wish!). Find: \d(\d\d)\d -- Change to: $1 -- Find Format: Footnote Reference
>>
>> Well this can't be found apparently. I want to find these numbers and delete the first and 4th digit. That's all. Why won't InDesign help here?
>
>The superscripted footnote number doesn't register as digit(s), it's a ``Footnote marker'' --- instead use something like:
>
>\d*~F\d*
>
>but you can't (IME) replace the footnote back using GREP, so instead, you should assign a formatting which isn't used in the document to the digits and the footnote marker, then search for digits w/ that formatting and replace w/ nothing (and no formatting) deleting only the digits, leaving the footnote marker.
>
>William
>
>--
>William Adams
>senior graphic designer
>Fry Communications
>Sphinx of black quartz, judge my vow.
>
>--
>You received this message because you are subscribed to the Google Groups "InDesign talk" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to indesign-tal...@googlegroups.com.
>To post to this group, send email to indesi...@googlegroups.com.
>Visit this group at http://groups.google.com/group/indesign-talk.
>For more options, visit https://groups.google.com/groups/opt_out.


--
___________________________________________________

RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________

WWW: http://www.shelterpub.com

Ann_Camilla

unread,
Aug 15, 2013, 5:09:36 AM8/15/13
to indesi...@googlegroups.com
Thanks Rick -- that produces a <?>
No idea what that is but I'll just carry on plodding through, one by one, matching up to the footnote at the bottom of the page and deleting the unnecessary fn ref numbers in the actual text. Sigh!

Thanks for trying though. Much appreciated.
Ann


On Thursday, 15 August 2013 08:48:06 UTC+1, Rick Gordon wrote:

What about:

FIND: \d+(~F)\d+
CHANGE TO: $1

Rick Gordon

------------------

On 8/14/13 at 10:09 AM -0400, William Adams wrote in a message entitled
"Re: [ID] GREPping digits":

>On Aug 14, 2013, at 10:00 AM, Ann_Camilla wrote:
>
>> I'm a complete novice where GREP is concerned. I have this book to do, about 600 pages and each page has half a dozen footnotes. For some reason InDesign wouldn't bring the footnotes in although I've rootled around in the Word document and can't understand why. I saved the Word doc as RTF. No footnotes at all. So I saved it as .docx and voil�, footnotes.

William Adams

unread,
Aug 15, 2013, 7:30:20 AM8/15/13
to indesi...@googlegroups.com
On Aug 15, 2013, at 3:48 AM, Rick Gordon wrote:

> What about:
>
> FIND: \d+(~F)\d+
> CHANGE TO: $1

As I noted:

On Aug 14, 2013, at 10:09 AM, William Adams wrote:

> you can't (IME) replace the footnote back using GREP

On Aug 15, 2013, at 5:09 AM, Ann_Camilla wrote:

> I'll just carry on plodding through, one by one, matching up to the footnote at the bottom of the page and deleting the unnecessary fn ref numbers in the actual text. Sigh!


Why not mark them as I described? That should do it in two find-replace operations:

On Aug 14, 2013, at 10:09 AM, William Adams wrote:

> you should assign a formatting which isn't used in the document to the digits and the footnote marker, then search for digits w/ that formatting and replace w/ nothing (and no formatting) deleting only the digits, leaving the footnote marker.

To be more specific:

- search for: \d*~F\d* --- replace w/ (for example) the formatting Opentype Features Stylistic Set 20
- clear the search and replace fields
- search for all digits formatted w/ Opentype Features Stylistic Set 20, replace w/ nothing

Carol F Majors

unread,
Aug 15, 2013, 9:20:27 AM8/15/13
to indesi...@googlegroups.com
When I am replacing with something just to tag the item, I often use color. It works particularly well in footnotes or if you're looking for certain kerning pairs.

Rick Gordon

unread,
Aug 15, 2013, 1:34:54 PM8/15/13
to indesi...@googlegroups.com
Ok. I just tested something that works, but it's two-pass:

FIND:
\d+(?=~F)
CHANGE TO:
[empty string]

FIND:
(?<=~F)\d+
CHANGE TO:
[empty string]

With these, you're not replacing the footnote marker; you're just removing the digits next to it.

If your sure there's only one digit on each side of the footnote marker to be removed, then ...

FIND:
\d+(?=~F)
CHANGE TO:


FIND:
(?<=~F)\d+
CHANGE TO:

... would be safer, in case there is some possibility of another number that SHOULD be kept.

Rick Gordon

------------------

On 8/15/13 at 7:30 AM -0400, William Adams wrote in a message entitled
"Re: [ID] GREPping digits":

Ann_Camilla

unread,
Aug 16, 2013, 5:03:27 AM8/16/13
to indesi...@googlegroups.com
That's great Rick. Thank you so so much for taking all this time to help me out. So much easier than peering at the text and carefully backspacing the unnecessary numbers.

Thank you
Ann

Rick Gordon

unread,
Aug 16, 2013, 5:57:05 AM8/16/13
to indesi...@googlegroups.com
I meant:

If your sure there's only one digit on each side of the footnote marker to be removed, then ...
FIND:
\d(?=~F)
CHANGE TO:


FIND:
(?<=~F)\d
CHANGE TO:


... would be safer, in case there is some possibility of another number that SHOULD be kept.
I forgot to delete the + signs in the variant.

------------------

On 8/16/13 at 2:03 AM -0700, Ann_Camilla wrote in a message entitled

Ann_Camilla

unread,
Aug 16, 2013, 6:40:11 AM8/16/13
to indesi...@googlegroups.com
Rick, I'm SO grateful. You've no idea how much time you saved me as I've just completed Part 2 of this book in quarter of the time that it took me to lay out Part 1. In Part 2, I did Fns 1-99 by hand and then used your 2 GREPs -- the one that removes the last number and then the one that removes the first two, cautiously at first but then BAM!! 627 Fns resolved! All I had to do then was find the odd Fns that were stored higgledy piggledy and related to the notes in the tables. When will that be resolved by Adobe?

Thank you so much for your help -- it's brilliant.
Ann
Reply all
Reply to author
Forward
0 new messages