• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Changing Firstname Lastname using GREP

Community Beginner ,
Jun 30, 2022 Jun 30, 2022

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!

TOPICS
How to

Views

340

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2022 Jun 30, 2022

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 )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

Below is an example of what I have. The first image (Lastname Firstname), the second image (Firstname Lastname). I'm wondering what code I need to create the second image, Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2022 Jun 30, 2022

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...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 30, 2022 Jun 30, 2022

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied


@Peter Spier wrote:

Any names in your list that have three parts?


 

Azam S M Fasihul has four parts.

 

61174F0C-4361-4C8D-928C-324EB4C4C462.jpeg

 

Jane

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 30, 2022 Jun 30, 2022

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2022 Jun 30, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

That middle parenthese should have a \s in it

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 01, 2022 Jul 01, 2022

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 )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 01, 2022 Jul 01, 2022

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 01, 2022 Jul 01, 2022

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines