Mobile app version of vmapp.org
Login or Join
Heady304

: GREP duplicate line of text Is it possible to duplicate lines of text with GREP? Here is exactly what I would like to do; I have a list of letters and numbers that looks like this:

@Heady304

Posted in: #AdobeIndesign #Automation #BatchProcessing #Grep

Is it possible to duplicate lines of text with GREP? Here is exactly what I would like to do; I have a list of letters and numbers that looks like this:


R1H3BOA2HA4

R1H3BOA2H4

R1H2H3BO4


And I need it to be like this:


R1H3BOA2HA4=R1+H3+BOA2+HA4

R1H3BOA2H4=R1+H3+BOA2+H4

R1H2H3BO4=R1+H2+H3+BO4


So basically I would like to duplicate every line, add the = symbol between the original and the copy and then add + after the numbers of the copy except for the last number. I understand how GREP works but I’m very bad with the syntax.
Any idea? Thank you for your help!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Heady304

1 Comments

Sorted by latest first Latest Oldest Best

 

@Bethany839

here is the pattern to match
this matches any character one or more times followed by a number (repeated 4 times), the parentheses saves that value then you can recall those saved values with $ and then the corresponding number of the saved value e.g first second

([lu]+?d)([lu]+?d)([lu]+?d)([lu]+?d)

this is your replace
=+++

using indesigns grep menu the (@) symbol in the find and replace dialog can help with the syntax

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme