[R] escape characters in shell commands

2011-05-24 Thread James Rome
On a Windows platform I am trying to count the number of lines in a file. In a DOS window, the following works: C:\Users\jarfindstr /R /N ^ D:\my_dir\my_file | find /C : 5317 (it works with double \\ also) But in R, I need to make this string up with the file name I get from file.choose():

Re: [R] escape characters in shell commands

2011-05-24 Thread Steven Kennedy
As a different approach, you could just use the readLines function: length(readLines(D:\my_dir\my_file)) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] escape characters in shell commands

2011-05-24 Thread Gabor Grothendieck
On Tue, May 24, 2011 at 1:40 PM, James Rome jamesr...@gmail.com wrote: On a Windows platform I am trying to count the number of lines in a file. In a DOS window, the following works: C:\Users\jarfindstr /R /N ^ D:\my_dir\my_file | find /C : 5317 (it works with double \\ also) But in R, I