awk: extract stuff to file

Signed-off-by: Fudong Bai <fudongbai@gmail.com>