Hi All
I have a file which has five columns in each rows.
cat file.txt
a|b|c|d|e
1|2|3|4|5
a1|a2|a3|a4|a5
.
.
.
I need to make sure that there are no less than five or more than five columns (in all the rows) by mistake. I tried this :
cat file.txt | awk 'BEGIN{FS="|"};{print NF}' > file1.txt
The above code is giving me the count of fields for each row. Can anybody help me modify it a little more so that the moment for a particular row it does not match five it will print me the row?