def process_infile old_table = CSV.open('file.csv','r') old_table.each do |row| # copy the row to x x = row # now that I have copied the row, how do I delete it from the array old_table? # find the two other rows that correspond to x and extract them to y and z. # use data from x, y, z to write a row in the new_table for newfile.csv end end