Re: [R] Search within a file

2005-11-04 Thread Tuszynski, Jaroslaw W.
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Seth Falcon Sent: Friday, November 04, 2005 1:44 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] Search within a file On 3 Nov 2005, [EMAIL PROTECTED] wrote: I am looking for a way to search a file for position of some expression, from

[R] Search within a file

2005-11-03 Thread Tuszynski, Jaroslaw W.
Hi, I am looking for a way to search a file for position of some expression, from within R. My current code: sha1Pos = gregexpr(sha1, readChar(filename, file.info(filename)$size))[[1]] Works fine for small files, but text files I will be working with might get up to Gb range, so I was trying

Re: [R] Search within a file

2005-11-03 Thread Gabor Grothendieck
Would this be ok (on Windows, use grep on UNIX): # line numbers of all lines conitaining R in the R README file setwd(R.home()) as.numeric(sub(:.*, , system(findstr /n R README, intern = TRUE))) On 11/3/05, Tuszynski, Jaroslaw W. [EMAIL PROTECTED] wrote: Hi, I am looking for a way to search

Re: [R] Search within a file

2005-11-03 Thread Seth Falcon
On 3 Nov 2005, [EMAIL PROTECTED] wrote: I am looking for a way to search a file for position of some expression, from within R. My current code: sha1Pos = gregexpr(sha1, readChar(filename, file.info(filename)$size))[[1]] Works fine for small files, but text files I will be working with