Besides taking this to the Mac OS X Technologies Unix Forum, I would suggest you post an example of text you want to mung via awk.
And put the example text inside of
...
...example text here...
...
the {code} tags will prevent the forum software from messing with your text.
With example text in the Unix forum, we will be able to experiment with your text and see if there is a useful awk (or maybe perl) solution.