Konrad Meyer wrote: > On Friday 10 August 2007 02:09:56 am Konrad Meyer wrote: >> my_data = $1 > Better yet: > READ_BYTES = 16 > content = File.open('foo'){|f| f.read } > my_data = content[content.index("find this string"), READ_BYTES] > # I tried to combine Lutz's and my earlier ideas > > Though this of course assumes the string is found. I don't care about huge file at present and this method works for me. Thanks Konrad and Lutz. -- Posted via http://www.ruby-forum.com/.