GREP to move text to end of parahraph
- This topic has 4 replies, 3 voices, and was last updated 4 years, 6 months ago by .
- You must be logged in to reply to this topic.
Learn / Forums / General InDesign Topics / GREP to move text to end of parahraph
Learn / Forums / General InDesign Topics / GREP to move text to end of parahraph
Hey all,
I have a weird problem i’m trying to work around.
I have a bunch of products with dates on them that need to be moved to the end of a line. (e.g. 08-12 product name –> product name 08-12).
I can find the dates with a GREP input like this (\d\d[-]\d\d) and its accurate enough, and finding the end of a paragraph is not a problem, but I can’t seem to make them work together so I can separate them.
basically I want to be able to put into the replace field “$2 $1” to get what i need, but I’m still really new to GREP. I’m not sure what steps I’m missing to get to this point.
Thanks for any help,
Cam H
I think you need to put each part in parentheses… for example, (\d\d-\d\d) (.+)
Then $2 will refer to the 2nd part, and $1 refers to the first part.
that worked perfectly, thank you!
Hey Guys,
I the same problem but cant seem to make it work, i need the following
123 product name —> product name 123
123 product name —> product name 123
i guess its easier since its just numbers, David said something about separate in parentheses
Any help would mean a lot since we are talking about 5000+ products.
thanks in advance
Nevermind guys
Read a little more careful what you guys said and made work with
Find: (\d+)(.+)
Replace $2 $1
Thanks
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.
You have to be logged in to save.
Not a member? Join Today - it's FREE!