I took the data and tried this:

([a-z]\.)([a-z]+)\s+\(([^\)]+)\)(\s*(and){0,1}\s*)

Replace as

\1\2\t\3\n

You stated an extra column needed, so used \t (tab inserted). This did your 
test data in one pass.

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Feb 9, 2022, 13:42 -0800, Howard <[email protected]>, wrote:
> I have a column with data like this, where each name contains just the first 
> initial, a period, and the last name:
>
> D.Green (59-72) and B.Valentine (12-19)
> D.Green (69-75)
> D.Green (55-58)
> J.Torborg (13-25) and D.Green (46-78)
> J.Torborg (72-90)
> B.Harrelson (74-80) and M.Cubbage (3-4)
> D.Johnson (20-22) and B.Harrelson (71-49)
> D.Johnson (87-75)
>
> Some rows have one name and a pair of numbers in parentheses separated by a 
> dash, and some rows have two names, each followed by a pair of numbers in 
> parentheses separated by a dash.
>
> In each row, I can extract the first name (both the initial and the last 
> name) and put a space between them using `^([A-Z]\.)([A-z,a-z]+)` and `\1 \2`
> with all results appearing in their own column.
>
> What I need help to do is this:
> 1. Using GREP, I need to extract the numbers in parentheses after the first 
> names and put them in their own column without parentheses.
> 59-72
> 69-75
> 55-58 etc.
>
> 2. In those rows with a second name, using GREP I need to extract the second 
> names and put them in their own column, so they look like this:
> B. Valentine
> D. Green
> M. Cubbage
> B. Harrelson
>
> I also need to extract the numbers in parentheses after the second names, but 
> believe that I can figure out how to do that from the answer to #1 above.
>
> Thanks,
> Howard
> --
> This is the BBEdit Talk public discussion group. If you have a feature 
> request or need technical support, please email "[email protected]" 
> 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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/e3034738-5b73-4c3b-a016-7a88615d5f54n%40googlegroups.com.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/a5742e3c-daa6-431e-a56f-52f7188b38c2%40Spark.

Reply via email to