Columns: awk '{print NF}' file | sort -nu | tail -n 1
Use head -n 1 for lowest column count, tail -n 1 for highest column count.
Rows: cat file | wc -l or wc -l < file for the UUOC crowd.
Columns: awk '{print NF}' file | sort -nu | tail -n 1
Use head -n 1 for lowest column count, tail -n 1 for highest column count.
Rows: cat file | wc -l or wc -l < file for the UUOC crowd.