Find Number of fields in a file
To find the number of fields in a TSV file just do the following:
First calculate the number of tabs:
$ head -1 /tmp/file.txt | egrep -o -E $'\t' | wc -l
16
The number of fields is number of tabs separating the fields + 1
16 + 1 = 17