Hi Howard,
You could try this to get tab separated fields:
Find:
(\S+\.)(\S+)\h*\((\d+-\d+)\)\h*(?:and\h*(\S+\.)(\S+)\h*\((\d+-\d+)\))?
Replace:
\1 \2\t\3\t\4 \5\t\6
HTH,
Jean Jourdain
On Wednesday, February 9, 2022 at 10:42:41 PM UTC+1 Howard 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/32f97811-72ef-4b0f-844b-6489620eb03an%40googlegroups.com.