I want to count all the records in a table through awk but NR prints record nos of all records not the total count. I even tried:
NF==4,count++{print count}
I guess you mean total number of lines. In general, you should use wc -l for this. If you want to do this using awk, use
wc -l
awk '{print NR}' | tail -1
If you only want to use awk, do
awk 'BEGIN{i=0}{i++;}END{print i}'