Friday, June 24, 2016

34. Counting number of column of a data file in linux

In order to count number of columns of a data file, one could simply type the following command in the terminal:

head -n 1 file.name | awk'{print NF; exit}'

No comments:

Post a Comment