Matching words based on column headers

Hi ,

Pls help on this.

Input file:

NAME1 BSC1

[LEFT] TEXT ID 1
MAINSFAIL
TEXT ID 2
DGON
TEXT ID 3
lOADONDG

NAME2 BSC2
TEXT ID 1
DGON
TEXT ID 3
lOADONG[/LEFT]

Text Id wil go upto 25

Output required:
NAME1 BSC1 MAINSFAIL DGON lOADONDG
NAME2 BSC2 DGON NULL LOADONDG

So how about the preview code in http://www.unix.com/shell-programming-scripting/144748-help-formating-file-field-separator.html\#post302455565

If you understand that code, you can adjust a little bit to meet your new request.