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
Post a Comment