(qqq)
aaa 111
bbb 222
and I want to make it look like
aaa 111 (qqq)
bbb 222 (qqq)
where some lists have only aaa
and some have both or more but all end in a number
the list should be considered ended if another (qqq) shows up
My algorithm might be:
Find line with first non-blank character is paren
cut that lineinto buffer
go to end of subsequnt lines ending in number
insert the paren's field after the number
repat for contiguous line (between one and four)
if you run into a blank line or parent's field, stop and start over
- = -
Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus, BioStrategist
http://www.panix.com/~vjp2/vasos.htm http://www.facebook.com/vasjpan2
---{Nothing herein constitutes advice. Everything fully disclaimed.}---
[Homeland Security means private firearms not lazy obstructive guards]
[Urb sprawl confounds terror] [Phooey on GUI: Windows for subprime Bimbos]
> I have a file that has a series of lists
>
> (qqq)
> aaa 111
> bbb 222
>
> and I want to make it look like
>
> aaa 111 (qqq)
> bbb 222 (qqq)
>
> where some lists have only aaa
> and some have both or more but all end in a number
>
> the list should be considered ended if another (qqq) shows up
>
> My algorithm might be:
> Find line with first non-blank character is paren
> cut that lineinto buffer
> go to end of subsequnt lines ending in number
> insert the paren's field after the number
> repat for contiguous line (between one and four)
> if you run into a blank line or parent's field, stop and start over
If you do not receive an answer here, try asking in
<news:gnu.utils.help>
or
<news:comp.unix.shell>