From: Tobias Reif Date: 2002-03-12T07:43:09+09:00 Subject: Re: Using 'uniq' question Aha, thanks for #find, Joel. So the that would be: ----- records = '100827 1000 1516 100792 1000 1698 100792 1000 1698' record_lines = records.split "\n" unique_records = [] record_lines.select do |line| first_n = line.split()[0] unless unique_records.find {|el| el.split()[0] == first_n} unique_records.push line end end sorted_records = unique_records.sort do |a,b| a.split()[0].to_i <=> b.split()[0].to_i end puts sorted_records # 100792 1000 1698 # 100827 1000 1516 ----- How to write that much more elegantly (more expressive and concise)? Tobi -- * peace&love. * http://www.pinkjuice.com/