awk -f scriptfile

Hi.

I have a file containing something like this:
1141 2 12355 0 0 1196418669 Runtime error

field number $6 is a unix timestamp. I would like to convert this timestamp to something readable like: (1196418669=Fri Nov 30 11:31:09 2007)

Fri Nov 30 11:31:09 2007 Runtime error

Can this be done with a script, or more/tail, awk/sed ?

Thanks
Benny

If you have GNU Awk:

$ echo "1141 2 12355 0 0 1196418669 Runtime error"|awk '$6=strftime("%A %b %d %H:%M:%S %Y",$6)'
1141 2 12355 0 0 Friday Nov 30 11:31:09 2007 Runtime error

Otherwise you could use perl (I suppose?).

Thanks for the tip. It is very usefull.