Column printing in awk

Experts,

i have a following file containing data in following manner.

              1      2480434.4   885618.6        0.00        1948.00
                                                                 40.00      1952.00
                                                                 80.00      1961.00
                                                                120.00     1977.00
               2       2480653.8  885738.3        0.00         1948.00
                                                                  40.00       1952.00
                                                                  4000.00   4938.00
                                                                  4040.00   4938.00
               3      2480873.3  885858.0         0.00         1948.00
                                                                  40.00       1952.00
                                                                  80.00       1961.00
                                                                  4100.00   4938.00

Desired output is like below 

    2480434.4    885618.6       0     1948
    2480434.4    885618.6     40     1952
    2480434.4    885618.6     80     1961
    2480434.4    885618.6    120    1977
    2480653.8    885738.3         0    1948
    2480653.8    885738.3        40    1952
    2480653.8    885738.3    4000    4938
    2480653.8    885738.3    4040    4938
    2480873.3    885858             0    1948
    2480873.3    885858           40    1952
    2480873.3    885858           80    1961
    2480873.3    885858         4100    4938

Any help/suggestion on the above request is highly appreciated . I tried a lot for good editing , but i think i am clear with my question above

Thanks & Regards

Could you please wrap the input and output data in code tags. Not able to understand your input and output format.

```text
 ... 
```

Something which works on your sample:

awk 'NF==2{$4=$1;$5=$2;$2=p2;$3=p3}
NF==5{p2=$2;p3=$3}
{print $2+0,$3+0,$4+0,$5+0}' OFMT='%.1f' file

Change OFMT value to meet your requirement.

One way,

awk '/^$/ {next} NF>4 {f1=$2;f2=$3;print f1,f2,int($4),int($5)} NF<4{print f1,f2,int($1),int($2)}' file

2480434.4 885618.6 0 1948
2480434.4 885618.6 40 1952
2480434.4 885618.6 80 1961
2480434.4 885618.6 120 1977
2480653.8 885738.3 0 1948
2480653.8 885738.3 40 1952
2480653.8 885738.3 4000 4938
2480653.8 885738.3 4040 4938
2480873.3 885858.0 0 1948
2480873.3 885858.0 40 1952
2480873.3 885858.0 80 1961
2480873.3 885858.0 4100 4938

If you don't have blank lines, Remove the first part of the command.

Dear clx,

your suggestion worked well but i want the third and fourth column to right padded like following

i tried following in your given code though it is working fine but when the next first values changes it gets distorted

awk '/^$/ {next} NF>4 {f1=$2;f2=$3;print f1,f2,int($4),int($5)}  NF<4{print (%-10s %-10s %-5s %-5s f1,f2,int($1),int($2))}' file
2480434.4 885618.6       0  1948 
2480434.4 885618.6     40  1952 
2480434.4 885618.6     80  1961 
2480434.4 885618.6   120  1977 
2480653.8 885738.3       0 1948 
2480653.8 885738.3     40 1952 
2480653.8 885738.3 4000 4938 
2480653.8 885738.3 4040 4938 
2480873.3 885858.0       0 1948 
2480873.3 885858.0     40 1952 
2480873.3 885858.0     80  961 
2480873.3 885858.0  4100 4938

THANKS
AMIT

xargs -n 11 < file | sed 's:\(^.\|\.00\)\( \|$\): :g' | awk '{gsub(/^ /,"");for(i=5;i<NF;i+=2)$i=RS$1FS$2FS$i}1'

Thanks a lot .