From: Ben Aroia Date: 2008-02-27T13:08:05+09:00 Subject: extracting hex keys from file Hello. I have a file that contains several values that I would like to read in as hex values (e.x. 3F 5A 6B 43 0E 2F AE...) I have some partial code: def getHash(file_in) f = File.new(file_in, "r") f.each_byte {|x| print x.to_s+"\n"} #need something here end I would like to extract the hex values from a known offset for a specific length, and I'm quite sure I can do that by accelorating the pointer a bit with a simple for loop. I come from a Java background and new to ruby so any help would be great. Thanks -- Posted via http://www.ruby-forum.com/.