Thread View: adobe.scripting.indesign
6 messages
6 total messages
Started by Michael_Diaz
Fri, 27 Mar 2009 18:38
Limit to number of GREP replacement text?
Author: Michael_Diaz
Date: Fri, 27 Mar 2009 18:38
Date: Fri, 27 Mar 2009 18:38
13 lines
1684 bytes
1684 bytes
Does anyone know if there is a limit to the number of replacement text (atoms) in InDesign GREP? I'm trying to parse data into 17 separate replacement text (atoms) but InDesign only seems to recognize $1, $2, $3, $4, $5, $6, $7, $8, and $9. InDesign GREP does not recognize $10, $11, $12, $13, etc. What InDesign GREP does instead is to insert $1 plus the number 0, 1, 2, 3, etc. So it seems that InDesign GREP has a limit of 9 replacement text (atoms). Is there a way to get InDesign to recognize more than 9?
I know I can probably accomplish this in two separate searches, but I would rather do it correctly in one search.
Here's my GREP example:
FIND: ^(.{2})(.{11})(.{21})(.{8})(.{4})(.{11})(.{6})(.{5})(.{5})(.{11})(.{8})(.{37})(.{13})(.{14})(.{4})(.{10})(.*)\r
CHANGE: $1\t$2\t$3\t$4\t$5\t$6\t$7\t$8\t$9\t$10\t$11\t$12\t$13\t$14\t$15\t$16\t$17\r
EXMAPLE DATA (inside the brackets): [ 101317 ABC BRAKES USA LTD ABC 754 1 4C FULL 4C RU 11 STOP FAST 9 188216-XXXX-090600 XXXX 090030 C3 PROOF WAIVED HOR 3 COL ]
I hope I explained the properly. Let me know if you need clarification.
Re: Limit to number of GREP replacement text?
Author: Dave_Saunders
Date: Fri, 27 Mar 2009 20:13
Date: Fri, 27 Mar 2009 20:13
3 lines
686 bytes
686 bytes
I believe that GREP by definition cannot go beyond $9. Dave
Re: Limit to number of GREP replacement text?
Author: jongware
Date: Fri, 27 Mar 2009 21:12
Date: Fri, 27 Mar 2009 21:12
4 lines
1063 bytes
1063 bytes
You realize your sample shows every single space being replaced by a single tab? Just checking. :-D Perhaps these lines have something unique, a special paragraph style for example -- in that case you could replace space by tab for that style alone. If there are other lines around with the same style, or something like that, you could make them special, by, f'r instance, changing the text colour or something. And yes, that means more than a single replace operation.
Re: Limit to number of GREP replacement text?
Author: Shane_Stanley
Date: Fri, 27 Mar 2009 21:37
Date: Fri, 27 Mar 2009 21:37
11 lines
1648 bytes
1648 bytes
On 28/3/09 7:13 AM, "Dave Saunders" <member@adobeforums.com> wrote: > I believe that GREP by definition cannot go beyond $9. Not really -- quite a few implementations can handle up to 99 backreferences. In fact, these days I suspect more do than don't. But it's hardly a great limitation in something like InDesign. -- Shane Stanley <sstanley@myriad-com.com.au> AppleScript Pro Sessions <http://scriptingmatters.com/aspro>
Re: Limit to number of GREP replacement text?
Author: Michael_Diaz
Date: Sat, 28 Mar 2009 00:17
Date: Sat, 28 Mar 2009 00:17
11 lines
907 bytes
907 bytes
You realize your sample shows every single space being replaced by a single
tab? Just checking.
It's putting a tab after X amount of characters, not every space.
Maybe someone from Adobe can verify if there is a limit in InDesign GREP.... or a method to get around the apparent 9 limit.
Re: Limit to number of GREP replacement text?
Author: Robert Tkaczyk
Date: Sat, 28 Mar 2009 13:13
Date: Sat, 28 Mar 2009 13:13
17 lines
1305 bytes
1305 bytes
my understanding of your GREP rule:
^ <- beggining of paragraph
(.{x}) <- exactly x any characters - including letter, numbers and white spaces except \r and \n
(.*) <- 0 or more of any character - including letter, numbers and white spaces except \r and \n
\r <- end of paragraph
so - after counting all numbers - your line should find all lines with minimum number of 171 characters ...
without spaces between (.{x}) - your line is equal to:
^(.{171,})\r
robin
--
www.adobescripts.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads