How To - Shell Scripting - Bash - Basics - 2 - AWK command usage
How To - Shell Scripting - Bash - Basics - 2 - AWK command usage Hello Everyone, In this post I will share what I have learned on awk . A little bit introuduction of awk AWK is a domain-specific language designed for text processing and typically used as a data extraction and reporting tool. Like sed and grep, it is a filter, and is a standard feature of most Unix-like operating systems awk has more variety of usages and all that information is well documented at https://www.gnu.org/software/gawk/manual/gawk.html All the code [more code in Gitlab repo than in blog, cause I am too lazy to reproduce my work :( ], along with sample files I am using in this blog post are commited to Github: https://github.com/rajagennu/awk_tutorial AWK IF-Else File: answers.txt a,1,1 b,3,4 c,5,2 d,6,1 e,3,3 f,3,7 awk -F ',' '{if( $2 == $3 ){print $1 "," $2 "," $3 } else {print "No Duplicates"}}' answers.txt output a,