Using R, how to find the line number of a specific phrase in a file without opening the file? -


i new r. have large (3.2 gb) txt file containing 2 columns. first column has human genome sequence position , second column has value corresponding each position. want find line numbers specific positions first column , read lines table in r. cannot import file because of memory issue. here example of r code tried line number of 1 specific position first column of data file. data file called my.data.

con <- file("my.data",open="r"); grep("13108", con) 

grep not work.

i appreciate if can tell me correct code.

try along lines of:

read.csv(pipe("grep 13108 my.data"), ...) 

(fill parameters appropriately data)


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -