use awk and sed to parse file.