I am finding that the following logic works, yet when applied in the
attached file, it fails...

a = [['head1','head2','head3'],['a','b','c'],['x','y','z']]
puts a.class
headings =a[0]
puts headings.class
b = a
#puts a
b.shift
puts b.class


#puts headings
mark1 = headings.index("head2")
puts mark1
mark2 = headings.index("head3")
puts mark2
puts "\n*****************"

b.each do |row|
  row.each do |elem|
    if row.index(elem) == mark1
      puts "Selected mark1:  #{elem}"
    elsif row.index(elem) == mark2
      puts "Selected mark2:  #{elem} "
    else
      puts "other"
    end
  end
end

Attachments:
http://www.ruby-forum.com/attachment/1779/fstcsv_xml_arrarrs.rb

-- 
Posted via http://www.ruby-forum.com/.