Archive for July 2nd, 2009

Using Awk To Prefix Lines With Millisecond Timestamp

Thursday, July 2nd, 2009

Here is a handy way to get awk to preprocess a line and add a timestamp (Put here as I will probably forget how to do this straight away again!)


echo "foo,bar" | awk '{x="'"`date +%Y%M%d%S%N`"'"; printf "%s,%s\n",x,$0 }'