> 2) Read one entry, do something to the entry, then discard it and read > in the next entry. This is what I want to do. Read one entry, extract information from it, then read next entry. He says using an array will take up a lot of memory so he said use a buffer. > But, you will end up reading every entry twice, which > is stupid. The easiest way to read in the file and prepare each entry > is to set the input separator to "\n\n", then use each() to read in a > paragraph, then use split("\n") to split each entry into lines, then add > back a \n to the first line. > > Also, are you aware that this: > >>gi|456299107|ref|NM_2342343.3Acc2| Def2 zgc:65895 (zgc:65895), mRNA\n > GTCGCTGGGTCGAAAAGTGGTGCTATATCGCGGCTCGCGTCGATGTCGCGATG <-- no "\n" > CGTGCGCGCGAGAGCGCGCTATGATGAAAGGATGAGAGAG <-- no "\n" > > is equivalent to: > >>gi|456299107|ref|NM_2342343.3Acc2| Def2 zgc:65895 (zgc:65895), mRNA > GTCGCTGGGTCGAAAAGTGGTGCTATATCGCGGCTCGCGTCGATGTCGCGATGCGTGCGCGCGAGAGCGCGCTATGATGAAAGGATGAGAGAG Yes I am aware of that - I just put "no \n" for emphasis. Regarding the pos(), I think he said to use it as a guide to help with the detection of each ">" . Thanks for being patient and helping out. -- Posted via http://www.ruby-forum.com/.