Reputation: 565
using
system(paste("wc -l file_1.txt"))
in R to obtain the line number of a file The output is
1601 file_1.txt
My problem is that if I type system(paste("wc -l file_1.txt"))->kt and then
kt
[1] 0
I would need to be able to say whether
system(paste("wc -l file_1.txt"))->kt
kt[1]==1600
or not..but I cant access the elements from the system commadn or the printout...how can i do that to somehow check whether the file has 1600 lines without reading it into R first...
Upvotes: 7
Views: 89