AWK: pattern and actions

We write action in curly braces. But pattern can be written outside. Like;
Syntax
pattern { action }
Example
awk 'NR==52 {print $0;}'
For example you want to remove all spaces & tabs from all fields of a file.
Here, first you need to find out text contains spaces & tabs (pattern) only. So you can replace it by blank character. This is called action.
Example:
awk ‘/article-stack\.com/’ post-contents.txt
Above command will filter & print (as its default nature) all the lines which contain “article-stack.com”. Don’t worry about how we are doing. That I’ll explain in next session. Here, “/article-stack\.com/” is called pattern.
Now instead of printing complete line, you may prefer to print first some words or characters. Sometimes you just want to delete the matched pattern from the file. This all activity is called action.
I am not giving any example for this. Because you need to learn basic structure and syntax of AWK first.
You can understand patterns deeply only when you are clear with Regular Expressions.
