Copy link to clipboard
Copied
Need some help should be an easy one. I need to change Lastname Firstname to Firstname Lastname using GREP. What's the code that I need, Thanks!
Copy link to clipboard
Copied
Hi @Nick Cachiaras ,
please show a screenshot sample of what you have, a list of names perhaps?
Enable frame edge visibility and also show hidden characters so that we can exactly see how first name and last name is done in the text, where are end of line special characters or end of paragraph special characters, tabs, blanks etc.pp. Also show paragraphs before and after a certain sample of formatted text on an InDesign page.
Thanks,
Uwe Laubender
( Adobe Community Professional )
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Any names in your list that have three parts? Start with de, van, von, etc?
Those make it much more difficult...
Copy link to clipboard
Copied
Not that I can see from list... If you can you give me both great if not, that's fine too.
Copy link to clipboard
Copied
@Peter Spier wrote:
Any names in your list that have three parts?
Azam S M Fasihul has four parts.
Jane
Copy link to clipboard
Copied
Thanks for spotting that Jane! I'm not sure if there's variable that can control the amount of parts associated with the name. I'm pretty new to all of this, any help would be great, Thanks!
Copy link to clipboard
Copied
I suspect you will need a script to identify paragraphs with more than two words and mark them in some way for later manual treatment.
for two-word paragraphs you can use the following GREP:
Find ^(\w+)( )(\w+)$
Change $3$2$1
Copy link to clipboard
Copied
That middle parenthese should have a \s in it
Copy link to clipboard
Copied
Hi Peter,
well, this can happen, below the full expression pasted to the Insert/Edit code widget of the forum editor.
Find GREP:
^(\w+)(\s)(\w+)$
Change GREP:
$3$2$1
Regards,
Uwe Laubender
( Adobe Community Professional )
Copy link to clipboard
Copied
Thanks so much everyone! This really worked out great! New to a lot of this functions in InDesign, any resources that can point me in a good direction, always looking to learn.
Copy link to clipboard
Copied
One really good resource is https://creativepro.com/now-available-grep-in-indesign-3rd-edition/