From: Max Russell Date: 2008-04-23T20:00:05+09:00 Subject: Re: CSV nesting Max Russell wrote: > Jeremy Hinegardner wrote: > >> Completely off the cuff, untested, but this is the approach I'm thinking >> of. >> >> http://p.ramaze.net/1154 >> >> enjoy, >> >> -jeremy > > Thanks, although after looking at the FasterCSV docs. I'm thinking of > working with an array or arrays instead of a Hash. I've attached what I'm now using. I'm finding however that, due to the condition execution, my current code spits out all the other attributes before the two conditions: for i in 1..rows.length next if rows[i].nil? if not rows[surname] or rows[forename] puts rows[i]#"Current attribute: #{rows[i]}" end if rows[surname] puts "" #puts "row #{i}" puts " " puts " #{rows[i][surname]}" puts " " end if rows[forename] #puts "row #{i}" puts " " puts " #{rows[i][forename]}" puts " " end end The problem being that an if, elsif else construction doesn't seem to work... Attachments: http://www.ruby-forum.com/attachment/1769/fstcsv_xml_arrarrs.rb -- Posted via http://www.ruby-forum.com/.