# while( allNumbers = infile.gets)

infile.gets returns a "string" that contains a line of the file.

I guess that you want this line of code to extract the numbers in the 
file and put them into the allNumbers array. Remember that gets only 
reads one line in each iteration.

you can do it simply with

-- while ( allNumbers = infile.gets.scan(/\d+/) )

#scan extracts the numbers from the string and puts them into the 
allNumbers array.
# now with each iteration allNumbers contains the numbers in that line.
# if you want to put fifth number in the colA array you can do it like 
this.

-- while ( allNumbers = infile.gets.scan(/\d+/) )
--      colA.push(allNumbers[4])  # fifth number in allNumbers[4]
-- 
Posted via http://www.ruby-forum.com/.