Count the Number of Fields per Line

DESCRIPTION:
This function scans an ASCII text file and counts the number of fields on each line.

USAGE:
count.fields(file, sep, skip=0)

REQUIRED ARGUMENTS:
file:
the name of the text file of ASCII data. The file should contain one line per row of the table, with fields separated by the character in sep.

OPTIONAL ARGUMENTS:
sep:
the field separator. If missing, any amount of white space can separate items.
skip:
the number of lines in the file to skip before reading data.

VALUE:
a vector giving the number fields, in the sense of scan or read.table, on each line of the file.

SEE ALSO:
scan , read.table .