Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!talisker.lacave.net!lacave.net!not-for-mail From: Cee Joe Newsgroups: comp.lang.ruby Subject: Re: File position and buffers Date: Thu, 28 Apr 2011 13:27:37 -0500 Organization: Service de news de lacave.net Lines: 36 Message-ID: References: <10d8ae57765e21626a7c64873dcba807@ruby-forum.com> <97869b15e6f881b951b4b230011182e0@ruby-forum.com> NNTP-Posting-Host: bristol.highgroove.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: Quoted-printable X-Trace: talisker.lacave.net 1304015345 59189 65.111.164.187 (28 Apr 2011 18:29:05 GMT) X-Complaints-To: abuse@lacave.net NNTP-Posting-Date: Thu, 28 Apr 2011 18:29:05 +0000 (UTC) In-Reply-To: <97869b15e6f881b951b4b230011182e0@ruby-forum.com> X-Received-From: This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway X-Mail-Count: 382327 X-Ml-Name: ruby-talk X-Rubymirror: Yes X-Ruby-Talk: Xref: x330-a1.tempe.blueboxinc.net comp.lang.ruby:3647 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=C3=BAs Gabriel y= Gal=C3=A1n > suggested. Could you show me a simple example or refer me to a link? -- = Posted via http://www.ruby-forum.com/.=