All pastes #244291 Raw Edit

Untitled

public ruby v1 · immutable
#244291 ·published 2006-11-09 16:22 UTC
rendered paste body
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  endend