From: Francisco Martinez Date: 2010-07-10T03:01:24+09:00 Subject: Re: FIRST PROGRAMMING PROBLEM Array Alex Stahl wrote: > You can put individual elements into the array w/ the push operator > "<<": > > myArray << "someTxt" > > Then, if you want to print each value in the array, you would use > the .each iterator: > > myArray.each do |item| > puts item > end > > Between these two, you should be able to easily add the supporting code > you'll need to get your results. > > -Alex I Have done It: num=1 File.open("text.txt") puts "token#{num}= #{nom}" num=num+1 end it reads the wole text not considering each word or "." but reading each line...I need to put it in a method that calls "text.txt" and to use an array and the result must be each line one word. -- Posted via http://www.ruby-forum.com/.