\Header{count.fields}{Count the Number of Fields per Line}
\keyword{file}{count.fields}
\begin{Usage}
\begin{verbatim}
count.fields(file, sep = "", skip = 0)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{file}] a character string naming an ASCII data file
\item[\texttt{sep}] the field separator character.  Values on each line of the
file are separated by this character.  By default, arbitrary amounts
of whitespace can seperate fields.
\item[\texttt{skip}] the number of lines of the data file to skip before
beginning to read data.
\end{ldescription}
\end{Arguments}
\begin{Description}
\texttt{count.fields} counts the number of fields, as seperated by
\texttt{sep}, in each of the lines of \texttt{file} read.  It is used by
\texttt{\Link{read.table}};  a user will typically have no need for it.\end{Description}
\begin{Value}
A vector with the numbers of fields found.\end{Value}
\begin{SeeAlso}
\texttt{\Link{read.table}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
cat("NAME", "1:John", "2:Paul", file = "foo", sep = "\n")
count.fields("foo", sep = ":")
\end{ExampleCode}
\end{Examples}

