From: Arlen Cuss Date: 2008-02-28T20:59:46+09:00 Subject: Re: checking for blank line ------=_Part_15326_23744452.1204199995271 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Might I suggest avoiding such control structures: File.open("test.txt", "r").each_line do |line| array = line.strip.split(':') case array[0] when 'cn' puts array[1] when 'title' puts " Title: #{array[1]}" when 'company' puts " Company: #{array[1]}" else puts "-----" if line.strip.empty? end end.close This may or may not be ideal for you. You may also want to map the array like .map {|e| e.strip}, since extra spaces may be included. Arlen ------=_Part_15326_23744452.1204199995271--