Formatting info into columns

Hi

This question has kind of been asked before but I couldn't get any of the solutions to work.

I need to format fields being cut from a file into columns so it looks like a table.
e.g

Full name Address Hiredate
Joe Smith London 11.01.01
Bill King Liverpool 15.05.99
Harry Bloggs Leeds 12.11.04

I belive awk is used but I'm not sure how, if anyone could help that would be great

Thank you

awk ' { printf("%-20s%-15s%10s\n",$1" "$2,$3,$4) } ' file

One other possible ways may be ::

cat <filename> | column -t

However, the awk one mentioned above by anbu provides more formatted output.

Cheers, Murli.

Thanks for the replies

Hi Cray_murli, it seems that column command doesn't exist.

I have table, would like to output fisrt column each line. Used awk as anbu's but output just in one line.

Hope your helps. Thanks.

You might forgot to add newline character

awk ' { printf("%-20s%-15s%10s\n",$1" "$2,$3,$4) } ' file

Hi Every1,

Is there othr way to do the same, because awk will traverse each line and might become slow in case of very huge input file.

Correct me if I am wrong!

Thansk anbu23. I got mistake with command.

There is no way to reformat a file without reading and writing each line in the file. The awk solution would be hard to beat in speed.