get line number with bash in R -


using

system(paste("wc -l file_1.txt")) 

in r obtain line number of file output

1601 file_1.txt

my problem if type system(paste("wc -l file_1.txt"))->kt ,

kt [1] 0  

i need able whether

system(paste("wc -l file_1.txt"))->kt kt[1]==1600  

or not..but cant access elements system commadn or printout...how can somehow check whether file has 1600 lines without reading r first...

system returns return value of command default, need use intern argument:

system(paste("wc -l banner.p"), intern=t)->kt 

kt string like

<lines> <filename> 

and parse string.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -