Use awk to deduplicate instead of sed