From: Cee Joe Date: 2011-04-29T03:27:37+09:00 Subject: Re: File position and buffers 7stud -- wrote in post #995581: > You still have not told us what you are supposed to do with the stuff > you read in?? You can read a file line by line and print out each line > as you go and the maximum amount of memory used will be one line's > worth. However, if you are supposed to store all the lines in an > array, then you will read the whole file into memory. > >> Thanks guys for your helpful comments. I will be more >> descriptive. I am an intern and my mentor wants me to >> use the IO.pos to read the characters of the file >> until the character reaches the ">" symbol. > I am extracting text from each entry I read in, something I have figured out already. I want to read the file line by line and just store each entry into a buffer when it reaches the ">" symbol. THen extract specific info from it later. The entry lengths all vary as there long and short lengths. File is in text mode. > What problems is that giving you? You can create a loop, read the > character at pos(i), then increment i, and do what Jesús Gabriel y Galán > suggested. Could you show me a simple example or refer me to a link? -- Posted via http://www.ruby-forum.com/.