how to change positions of fields in a file in unix?

I have a file with below data

FILE1:

field1 field2 field3 field4 field5

456 2545789632789 457852 12548 6548458

252 4571258697425 245787 85746 5455555

44 5555555

12 4444444

I need data as below from above file:

FILE2:

field1 field2 field3 field4 field5

456 2545789632789 457852 12548 6548458

252 4571258697425 245787 85746 5455555

                44               5555555

                12               4444444


Source: unix

Leave a Reply