: 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:
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!
More posts by @Heady304
1 Comments
Sorted by latest first Latest Oldest Best
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
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.