Skip to content

count how many row i have in a txt file in a directory

3 messages · gianni lavaredo, Rainer Hurling, Robert J. Hijmans

#
On 26.02.2012 15:03 (UTC+1), gianni lavaredo wrote:
If I remember right from another thread, you are on Max OSX?

If so, you could try Unix alike commands like 'wc' (word count) with 
option 'l' for lines:

#as.numeric(unlist(strsplit(system("wc -l file.txt", intern=TRUE), 
split=" "))[2])

I suspect, there must be other, much more elegant methods ...

Rainer