Page 1 of 1

flipping names with leading numbers

PostPosted: Sat Sep 10, 2016 3:30 am
by Hal
new at this not to smart lol would like to flip first names with last names leaving the leading numbers and a having a comma between the last name and the first name, also some have three names, I found the commands they work but not the way I would like these are a couple of examples
BS0100-02 - George Strait - Go On
BS0100-03 - John Michael Montgomery - Little Girl

would like them to look like these

BS0100-02 - Strait, George - Go On
BS0100-03 - Montgomery, John Michael - Little Girl

found these the first one flip the names ok with the comma between the first and last name but strip the leading numbers found I could added them back in field 7 and 10
DO:
RegEx(1)
Search: (.+) (.+)( - .+)
Replace: \2, \1\3

found this, it left the leading numbers but no comma between last and first name and to much space between the names, found nothing for the three name issue
Regex(1)
Match:
(^[^-]+-[^-]+-)([^,]+),([^-]+)(-.+)
It selects the stuff between the dashes by looking for non dashes [^-]

Replace:
\1\3\2 \4

Include Ext. Not checked!

Re: flipping names with leading numbers

PostPosted: Wed Sep 14, 2016 4:07 am
by Hal
did I not post my question right? if any one can help me it would be much appreciated
thanks much

Re: flipping names with leading numbers

PostPosted: Fri Sep 16, 2016 9:03 pm
by Emerkamp
Hello:

BS0100-02 - George Strait - Go On
BS0100-03 - John Michael Montgomery - Little Girl

would like them to look like these

BS0100-02 - Strait, George - Go On
BS0100-03 - Montgomery, John Michael - Little Girl


By This:
This should work.

RegEx (1.)

Match: (.*) - (.*)\s(.*) - (.*)
Replace: \1 - \3, \2 - \4

Hope it helps.

Re: flipping names with leading numbers

PostPosted: Sun Sep 18, 2016 5:21 pm
by Hal
Can't thank you enough works great Thank You