I need to convert data formatted for humans into data formatted for a 
database. The actual document is subject to privacy regulation. The 
following is a mockup to illustrate the task. I need to convert this:

ART 200-2D Art I
First Level Requests
Aardvark, Amy 10
Badger, Billy 11
Cat, Carl 12

ART 200-2D Art I
Alternate Request
Dove, David 11
Fox, Fred 11
Gill, Gertrude 10

ART 215-2D Art II, Honors
First Level Requests
Kite, Kevin 11
Lizard, Larry 12
Mongoose, Marvin 11

into this:

ART 200 First Aardvark, Amy 10
ART 200 First Badger, Billy 11
ART 200 First Cat, Carl 12
ART 200 Alternate Dove, David 11
ART 200 Alternate Fox, Fred 11
ART 200 Alternate Gill, Gertrude 10
ART 215 First Kite, Kevin 11
ART 215 First Lizard, Larry 12
ART 215 First Mongoose, Marvin 11

So, I need to capture the course ID from one line, the request type from 
the next line, and then insert each of those into the beginning of each 
subsequent line, until the occurrence of a new course ID, at which point 
the course ID and request type are updated for insertion into the next 
block of lines...
... and so on for about 3,000 lines.

My grep skills are not up to the challenge. Can anyone help?

Thanks,
dp

-- 
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/446f907e-e61f-45c4-946a-261fafa0fa7an%40googlegroups.com.

Reply via email to