Question: how awk is better than sed?
Answer: It is mainly used to search and print data from text files. It has advanced programming constructs like for, while, do-while, and multi-dimensional arrays​. It is more robust than sed. Writing mathematical expressions in awk is easy.