NAWK Script not working fine

Hello to all

can any one help me out with a nawk script.
Actually i am having a shell script which uses nawk pattern searching
and it is not parsing the file properly.
I have been debugging it since long time, but nt able 2 find the root cause..

If any one can help me out with this one ..

Yes, there are plenty helpful people here.

What does the script, the input and the deserved ouput look like?

Thanks for your reply,

Input file looks like a report like this
Currency: JPY
SOBP=xxx (JAPAN)
ORG ACCT PR SOB PTD LOCAL
--------- ---- -- ---
Hardware
801140xxx 51 801 3,999,638.00
Software
80x140xxx 31 801 648,000.00
80x140xxx 31 801 1,596,400.00
80x140xxx 51 801 818,922.00
80x140xxx 31 801 121,415.00

And output file looks like

xx|106|07-07|1120xxxxx|112|S/W|02|USD| xxxxxx|1043|0x/1x/200x
xx|106|07-07|1120xxxxx|112|S/W|51|USD| xxxxxx|1043|0x/1x/200x

basically, input file is parsed to generate pipe delimited file which contains the information from input file.

What is happening here is, the no. of records does not equals the records in input file.

and also some special characters gets inserted in output file..

I really appretiate the people visited to this thread, but I would be glad do if the person visiting to this thread leave some comments or suggestions to this issue..