October 24th, 2011, 10:15 AM
-
Do I use some kind of backtrace here?
I need some help with a long list of text for a index. It is formatted as described below.
I want to find the first line that is bold below (a line without a tab?). And copy that line to each other line until the next line without a tab ... (See example below =)
FROM THIS:
HU11
Rebecca Magnusson\t14
Linn Samuelsson\t3
Lova Lundin\t22
MP1A
Magnus Axelsson\t16
Rune Bergström\t4
TO THIS:
HU11\tRebecca Magnusson\t14
HU11\tLinn Samuelsson\t3
HU11\tLova Lundin\t22
MP1A\tMagnus Axelsson\t16
MP1A\tRune Bergström\t4
InDesign can use GREP in find and change and take advantage of back reference \1 \2 etc.
Is this possible to do in one big search? I have several pages of the above described text block.
October 24th, 2011, 11:38 AM
-
Can't do it with just a regular expression. It would need some kind of loop somewhere.
Though that loop may be you clicking a button. Fix the Rebecca line manually and see if
Code:
^(([^\n\r\t]+)$\s+)(([^\n\r\t]+\t[^\n\r\t]+\t[^\n\r\t]+$\s+)*)([^\n\r\t]+\t[^\n\r\t]+$)
replaced with
works. It may have to cycle through the document a few times before it replaces everything.