From: Stefano Crocco Date: 2013-01-12T22:25:37+09:00 Subject: Re: How to take information from a text file and add them to an array On Saturday 12 January 2013 Adam Kennedy wrote > Hi Im trying to take a list of usernames from a text file then add them > to an array and check the array for a login verification process. Does > anyone know how this can be done? Ive searched google and found ways of > opening a file but and reading it but not actually adding it to an > array. Or am I going about this the completely wrong way? > > Thanks for your help > Adam K > > -- > Posted via http://www.ruby-forum.com/. Well, File.read read the file and give you its contents stored in a string. File.readlines does the same except that it returns an array where each entry contains a line of the file. After that, it's only a matter of extracting the information you need from the string(s). Stefano