#!/usr/bin/ruby -w require 'CSV' old_table = CSV.open('file.csv','r') counter = 0 new_table = Array.new old_table.each do |row| # p row rows = { :field1 => row[0], :field2 => row[1], :field3 => row[2], :field4 => row[3], } #counter += 1 #p counter new_table << row[:field1], row[:field2], row[:field3], row[:field4] end puts "Out of the block now" puts new_table