From: Joel Pearson Date: 2013-01-14T08:51:20+09:00 Subject: Re: How to take information from a text file and add them to an array And as always with Ruby, there's an even simpler way to write it: users_passwords = Hash[ File.foreach('input.txt').map { |line| line.chomp.split("\t") } ] p users_passwords I think that foreach would handle large files better than read or readlines too. -- Posted via http://www.ruby-forum.com/.