Use awk instead of sed/tr combination