ian ian - 1 year ago 75
R Question

Getting the number of lines in a text file in R

I have text file I am reading into R. eack line of text is the full name of a NCDF4 file. i would like to get a count of the number of files recorded in the test file. Surley there is a little bit of code to do that simpley

Answer Source

As I understand it, you are simply trying to figure out how many lines are in your txt file. Is that correct? If so, something like this will work:

dat <- readLines(path/to/txtfile.txt)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download