From: Johnathan Smith Date: 2007-12-06T05:28:05+09:00 Subject: Re: hash hi, thanks, i've got it to print out the hash although I'm getting a wierd output where its taking the first letter off the surname e.g: >ruby main.rb 3 {"ref1"=>["Book", "ittle, S R"], "ref2"=>["Journal", "mith, J"] can you see in my code where im going wrong? also, is it possible to print the different refrences on new lines? ill provide my code below thanks # # File.open('reference.txt').each do |line| if line =~ /^tag:/i $linecount += 1 end end puts $linecount # # # File.open('reference.txt') { | handle |tags = handle.read.split("\n\n") for tag in tags key, type, author = tag.split("\n") database[key[5..-1]] = [type[6..-1], author[9..-1]] end } p database # # -- Posted via http://www.ruby-forum.com/.