Stuart Clarke wrote:

> d = CSV.open(FILE, "r")
> #Open the as CSV
> d.each do |setA, setB|
> #2 columns of data
>     next
>     oldID = setB.to_s.strip
>     newID = setA.to_s.strip[/.*(?=\..+$)/]
>     renameFile(oldID, newID)
> #Call our object
>   end
> end

Does this really work at all? Doesn't 'next' just skip every line as 
soon as you've read it?

Otherwise, 'each' should do what you want: present you with one line at 
a time in setA and setB. Add a "puts" line inside the each block to see 
if that's what's happening:

  puts "Now processing #{setA.inspect},#{setB.inspect}"

If you're using 1.8, you may find FasterCSV works better - it's 
available as a gem. It's standard in 1.9.
-- 
Posted via http://www.ruby-forum.com/.