Frank,
thanks a lot it is working perfectly with nawk.
here also i have a small problem
if there are leading spaces in 2 consecutive lines then it is not considering the second one..
that is
*** input file
TEMP 014637065 014637065 517502 517502 RTE
517502 517502 RTE
226
AWATER_TEST 12325 23563 588323 2323 5656 32385 23235635
ANOTHER_TEST 12 5433 FTHH 5653 833
TEST 123 123 3235 5353 353 53 35 353 535 3
YTERS GJK JKLS
if leading spaces are there in lines 2 and 3 then the output should look like
TEMP 014637065 014637065 517502 517502 RTE 517502 517502 RTE 2634
AWATER_TEST 12325 23563 588323 2323 5656 32385 23235635
ANOTHER_TEST 12 5433 FTHH 5653 833
TEST 123 123 3235 5353 353 53 35 353 535 3
YTERS GJK JKLS
Can you pls help?
Also can you just explane me the awk code if you have time
Once again many thanks for youe help