Re: Extracting parts of names from full names

2020-02-29 Thread 'anotherhoward' via BBEdit Talk
I would like to thank everyone for their thoughtful comments. What I now 
realize works best for me is Sam's pattern with "\1 \2" in the replacement 
pattern and John's.

On Friday, February 28, 2020 at 11:08:34 AM UTC-5, John R M. Delacour wrote:
>
>
>
> On 28 Feb 2020, at 16:00, I wrote:
>
> Replace all with \1 \2
>
>
> …or Extract, of course!
>
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/c6506320-d933-401e-8483-07a6fb75e1b2%40googlegroups.com.


Re: Extracting parts of names from full names

2020-02-28 Thread 'anotherhoward' via BBEdit Talk
I would like to thank everyone for their thoughtful comments. Because of 
them, I realize that what would work best for me are Sam's with a space 
replacing the "\t" in the replacement pattern and John's.

On Friday, February 28, 2020 at 11:01:01 AM UTC-5, John R M. Delacour wrote:
>
>
>
> On 27 Feb 2020, at 21:43, 'anotherhoward' via BBEdit Talk <
> bbe...@googlegroups.com > wrote:
>
> I have a list of names in this format:
>
> B.J. Surhoff\surhob.01
> Bobby Bonilla\bonilbo01
>
> I want to extract the last names and separately extract what comes before 
> each last name 
> (which could be just the first name or two initials as in "B.J.") so that 
> I can later organize them this way:
>
> B.J. Surhoff
> Bobby Bobby
>
> I do not need the data after the slash.
>
> How can I use GREF (REGEX) to extract the last names and separately the 
> first/middle values?
>
>
> If you don’t need to script it,
>
> search for: (.+?) ([^ ]+?)\\.+
> Replace all with \1 \2
>
>
> JD
>
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/9f1b9c7b-c529-4cc6-8091-0a293b338a73%40googlegroups.com.


Re: Extracting parts of names from full names

2020-02-28 Thread John Delacour


> On 28 Feb 2020, at 16:00, I wrote:
> 
> Replace all with \1 \2

…or Extract, of course!

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/EC3902E9-B866-4BBB-B5E6-C9B69807B0FB%40gmail.com.


Re: Extracting parts of names from full names

2020-02-28 Thread John Delacour


On 27 Feb 2020, at 21:43, 'anotherhoward' via BBEdit Talk 
 wrote:

> I have a list of names in this format:
> 
> B.J. Surhoff\surhob.01
> Bobby Bonilla\bonilbo01
> 
> I want to extract the last names and separately extract what comes before 
> each last name 
> (which could be just the first name or two initials as in "B.J.") so that I 
> can later organize them this way:
> 
> B.J. Surhoff
> Bobby Bobby
> 
> I do not need the data after the slash.
> 
> How can I use GREF (REGEX) to extract the last names and separately the 
> first/middle values?

If you don’t need to script it,

search for: (.+?) ([^ ]+?)\\.+
Replace all with \1 \2



JD

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/71966DF5-1088-4F3F-83A1-28E446AAE77F%40gmail.com.


Re: Extracting parts of names from full names

2020-02-28 Thread ThePorgie
He might be doing a variable data job where the usage in one instance he 
needs the first name only. In another instance he needs the whole 
nameJust off the top of my head Darren.

On Friday, February 28, 2020 at 9:15:35 AM UTC-5, Darren Duncan wrote:
>
> What is the business case for this separation?  For all practical purposes 
> keeping the name as a single string is best.  A better solution to your 
> problem 
> may be changing anything that expects parts to expect a single combined 
> name 
> instead, which would then work for names of any nationality. -- Darren 
> Duncan 
>
> On 2020-02-27 1:43 p.m., 'anotherhoward' via BBEdit Talk wrote: 
> > I have a list of names in this format: 
> > 
> > Luis Gonzalez\gonzalu01 
> > Eddie Perez\perezed02 
> > B.J. Surhoff\surhob.01 
> > Bobby Bonilla\bonilbo01 
> > Keith Lockhart\lockhke01 
> > 
> > I want to extract the last names and separately extract what comes 
> before each 
> > last name 
> > (which could be just the first name or two initials as in "B.J.") so 
> that I can 
> > later organize them this way: 
> > 
> > *First   Last* 
> > LuisGonzalez 
> > Eddie  Eddie 
> > B.J. Surhoff 
> > Bobby Bobby 
> > Keith   Lockhart 
> > 
> > I do not need the data after the slash. 
> > 
> > How can I use GREF (REGEX) to extract the last names and separately the 
> > first/middle values? 
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/2a973054-4fc5-41ff-b224-0aa23c5a664e%40googlegroups.com.


Re: Extracting parts of names from full names

2020-02-28 Thread Darren Duncan
What is the business case for this separation?  For all practical purposes 
keeping the name as a single string is best.  A better solution to your problem 
may be changing anything that expects parts to expect a single combined name 
instead, which would then work for names of any nationality. -- Darren Duncan


On 2020-02-27 1:43 p.m., 'anotherhoward' via BBEdit Talk wrote:

I have a list of names in this format:

Luis Gonzalez\gonzalu01
Eddie Perez\perezed02
B.J. Surhoff\surhob.01
Bobby Bonilla\bonilbo01
Keith Lockhart\lockhke01

I want to extract the last names and separately extract what comes before each 
last name
(which could be just the first name or two initials as in "B.J.") so that I can 
later organize them this way:


*First       Last*
Luis        Gonzalez
Eddie      Eddie
B.J.         Surhoff
Bobby     Bobby
Keith       Lockhart

I do not need the data after the slash.

How can I use GREF (REGEX) to extract the last names and separately the 
first/middle values?


--
This is the BBEdit Talk public discussion group. If you have a feature request or need 
technical support, please email "supp...@barebones.com" rather than posting here. 
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/824baf58-2866-65dd-2e2c-46844671b516%40darrenduncan.net.


Re: Extracting parts of names from full names

2020-02-27 Thread Sam Hathaway
Do the “last names” in your dataset always consist of the final word 
before the backslash? If so, you can use:


Find: `(.*) (\S+)\\.*`
Replace: `\1\t\2`

But eventually you will need to deal with names that don’t fit this 
pattern and then you will be sad. For example, in the name Saúl 
Rodriguez Luna, the “last name” is “Rodriguez Luna”.


You might want to read this:
https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/

Hope this helps.
-sam

On 27 Feb 2020, at 16:43, 'anotherhoward' via BBEdit Talk wrote:


I have a list of names in this format:

Luis Gonzalez\gonzalu01
Eddie Perez\perezed02
B.J. Surhoff\surhob.01
Bobby Bonilla\bonilbo01
Keith Lockhart\lockhke01

I want to extract the last names and separately extract what comes 
before

each last name
(which could be just the first name or two initials as in "B.J.") so 
that I

can later organize them this way:

*First   Last*
LuisGonzalez
Eddie  Eddie
B.J. Surhoff
Bobby Bobby
Keith   Lockhart

I do not need the data after the slash.

How can I use GREF (REGEX) to extract the last names and separately 
the

first/middle values?

--
This is the BBEdit Talk public discussion group. If you have a feature 
request or need technical support, please email 
"supp...@barebones.com" rather than posting here. Follow @bbedit on 
Twitter: 

---
You received this message because you are subscribed to the Google 
Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/59705c02-51c1-40da-ac1f-dda43d3f0d8c%40googlegroups.com.



--
This is the BBEdit Talk public discussion group. If you have a feature request or need 
technical support, please email "supp...@barebones.com" rather than posting here. 
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/CF116F50-93DE-4E3C-B2CA-6E8FB16F56F9%40munkynet.org.


Re: Extracting parts of names from full names

2020-02-27 Thread Kerri Hicks
How confident are you in your data source that you will always have names
in the format of "string with no spaces" "space" "string with no spaces"?

Will you ever have names like:

Jamie Lee Curtis (space in the "first" names)
Onne van der Wal (space in the surname)

or other variants?

The expression will depend on your answer to that question.

--Kerri

On Thu, Feb 27, 2020 at 4:44 PM 'anotherhoward' via BBEdit Talk <
bbedit@googlegroups.com> wrote:

> I have a list of names in this format:
>
> Luis Gonzalez\gonzalu01
> Eddie Perez\perezed02
> B.J. Surhoff\surhob.01
> Bobby Bonilla\bonilbo01
> Keith Lockhart\lockhke01
>
> I want to extract the last names and separately extract what comes before
> each last name
> (which could be just the first name or two initials as in "B.J.") so that
> I can later organize them this way:
>
> *First   Last*
> LuisGonzalez
> Eddie  Eddie
> B.J. Surhoff
> Bobby Bobby
> Keith   Lockhart
>
> I do not need the data after the slash.
>
> How can I use GREF (REGEX) to extract the last names and separately the
> first/middle values?
>
> --
> This is the BBEdit Talk public discussion group. If you have a feature
> request or need technical support, please email "supp...@barebones.com"
> rather than posting here. Follow @bbedit on Twitter: <
> https://twitter.com/bbedit>
> ---
> You received this message because you are subscribed to the Google Groups
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to bbedit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/bbedit/59705c02-51c1-40da-ac1f-dda43d3f0d8c%40googlegroups.com
> 
> .
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/CAEmA4ubWJy31aSav4xLnusSLdxZFmVscJLs1zVj-o9Va-DiuCQ%40mail.gmail.com.