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:




And I need it to be like this:




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!


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 $1 second $2


this is your replace

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

Source : Link , Question Author : user23596 , Answer Author : Evan Oswald

Leave a Comment