From: Mateusz Tybura Date: 2008-08-01T19:28:49+09:00 Subject: Re: Read text file Pragash Mr. wrote: > Hi, > I have one text file for example > > > 9115 2008-06-20 07:26:35 > 91415 2008-06-20 07:26:32 > 9315 2008-06-20 07:26:33 > 2115 2008-06-20 07:26:05 > 15 2008-06-20 07:26:34 > 115 2008-06-20 07:26:35 > > > i need to read only first column i.e numbers like 9115 etc if you have > any solution reply me Try this: file = File.open("name.txt") columns = [] file.each_line do |line| columns << line.split(" ")[0] end p columns -- Posted via http://www.ruby-forum.com/.