There might be a simple way to do this, but it's been confusing me a
bit.
I have an array of arrays which I made to match the format of an excel
sheet or table.
I need to reject duplicates and only keep one "row" of each based on one
of the
"cells". With a single array, I could use uniq! to do this, but when I'm
comparing arrays against each other using only one of the elements, I'm
not sure how to go about this efficiently.
for example:
array = [[1,a,b],[1,a,c],[2,a,b]]
If I use a given sub array's [0] position as the unique reference, I'd
want to end up with:
array = [[1,a,b],[2,a,b]]
Obviously this is with much larger data but you get the idea.
Thanks for your time.
···
--
Posted via http://www.ruby-forum.com/.