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

GREP InDesign re-arranging multiple names

New Here ,
Nov 29, 2022 Nov 29, 2022

Copy link to clipboard

Copied

Hi,

I have a huge list of names that need to be ordered: Firstname Middlename Lastname

 Currently they are ordered like the following on the left (I've picked a couple of name variations)

 

Butcher Thomas - (Butcher: lastname) (Thomas: firstname)

de Boag Michael - (de Boag: lastname) (Michael: firstname)

Holland-Kemp Kelly - (Holland-Kemp: lastname) (Kelly: firstname)

Pitt Avery Mae-Anne - (Pitt: lastname) (Avery: firstname) (Mae-Anne: middlename)

Smith John Peter - (Smith: lastname) (John Peter: firstname)

 

I can re-arrange 2 names fine, but was wondering if there was any Grep that arranges variations like the examples above in a single document PLUS ordered alphabetically according to their last names?
Sorry if that's confusing...and I know it's a big ask. Any help would be appraciated. Thanks!

TOPICS
How to

Views

159

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 ,
Dec 03, 2022 Dec 03, 2022

Copy link to clipboard

Copied

There would be no way. You'd need a pattern.

Thomas

Micheal

Mae-Anne

John Peter

 

All have different patterns

Partnered with double barrel surnames, surnames singular.

 

There's no way to distinguish

Holland-Kemp Kelly

Pitt Avery Mae-Anne

Smith John Peter

 

The pattern is too diverse.

 

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
Engaged ,
Dec 16, 2022 Dec 16, 2022

Copy link to clipboard

Copied

Replying late to this as I just saw it, but if most of the names in your list are single firstname, single lastname, it probably wouldn't be too hard to find the outliers and manually join them where you don't want them to break, do the transposition using GREP and then replace the join characters with spaces. Here's what I mean: 

 

Butcher Thomas

de#Boag Michael

Holland-Kemp Kelly

Pitt Avery#Mae-Anne

Smith John#Peter

 

Find Grep: (.+) (.+)

Change Grep: $2 $1

 

Then find-change # to space. 

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 ,
Dec 16, 2022 Dec 16, 2022

Copy link to clipboard

Copied

LATEST

Already embedded within InDesign is a script (Scripts > Application > Samples > JavaScript > SortParagraphs.jsx which will sort alphabetically. That is half your battle, anyway.

 

A GREP might be: ^(.+)\s(.+) and change to $2 $1. It would leave behind the awkward name patterns that you might clean up manually.

Mike Witherell

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