For a file with data similar to this (i.e. store.dat file)
sid|storeNo|latitude|longitude 2|1|-28.03720000|153.42921670 9|2|-33.85090000|151.03274200
What will be the command to output the number of column names?
i.e. In the above example, this will be 4. (the number of channel characters + 1 in the first line)
I thought something like:
awk '{ FS = "|" } ; { print NF}' stores.dat
but it returns all rows instead of the first, and for the first row it returns 1 instead of 4
linux scripting unix bash shell
toop Dec 25 2018-11-11T00: 00Z
source share