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 $1$2$3$4=$1+$2+$3+$4

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.