Swapping order of words with GREP
- This topic has 3 replies, 3 voices, and was last updated 8 years, 7 months ago by .
- You must be logged in to reply to this topic.
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Swapping order of words with GREP
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Swapping order of words with GREP
Tagged: csv, Data Merge, GREP
Hey guys,
I have 1,500 photos that need to be inserted into an InDesign document and each need to have the name’s below the photo. This part is easy as it’s just a simple data merge. Where I’m having difficulty is that I have been supplied the names incorrectly. For example I would need it to appear ‘John Smith’ but I have been supplied the text as ‘Smith John’.
Is there any GREP command that can select the first word of each paragraph up until the space and then send it to the end of the paragraph?
If there is it is going to save me a days work!
Thanks in advance :)
Cheers,
Adam
What about this :
F : (\w+) +(\w+)
R : $2 $1
?
Otherwise you could think of a script to rename the files accordingly prior to data merging.
FWIW,
Also note that I discussed this same process in my video title on Data Merge at lynda.com
Awesome! Thanks guys. Just saved me a tonne of work.
Really appreciate the help! :)
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!