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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -