Description Usage Arguments Details Value See Also Examples
Determine number of lines in a text file
1 | determine_nlines(filename)
|
filename |
character containing the filename of the file of which the lines are to be counted. |
The routine counts the number of line endings. If the last line does not end in a line ending, but does contain character, this line is also counted.
The file size is not limited by the amount of memory in the computer.
Returns the number of lines in the file.
See readLines
to read in all lines a text file;
get_lines
and sample_lines
can be used to read in
specified, or random lines.
1 2 3 4 5 6 7 8 9 10 11 | # Create temporary filename
tmpcsv <- tempfile(fileext="csv")
# Generate file
writeLines(letters[1:20], con=tmpcsv)
# Count the lines
determine_nlines(tmpcsv)
# Cleanup
file.remove(tmpcsv)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.