Given a file with data like this (i.e. stores.dat file)
sid|storeNo|latitude|longitude 2|1|-28.03720000|153.42921670 9|2|-33.85090000|151.03274200
Unless you're using spaces in there, you should be able to use | wc -w on the first line.
| wc -w
wc is "Word Count", which simply counts the words in the input file. If you send only one line, it'll tell you the amount of columns.
wc