I am counting the number of fields in a row and spit out the row if the number of fields are more than the expected number of fields as below
awk -F”,” ‘{ if ( NF != ‘${x}’ ) print}’ filename
Where x is the expected number of fields. But this is throwing error if the file has more than 100 fields. What is the alternative approach for this.
Sample data:
1,aaaa,bbbb
2,aaaa,bbbb,cccc
3,aaaa,bbbb
Expected output
The line which has more than 3 fields should be displayed
2,aaaa,bbbb,cccc
The main issue here is my file has more than 100 columns and awk is throwing error as it has 100 fields limitation.