2008/2/5, 7stud -- <bbxx789_05ss / yahoo.com>:
> Lovell Mcilwain wrote:
> >
> > The code I posted is exactly what I ran aside for giving you
> > hundrededs of lines of email.  The example is exactly what I ran to
> > get the results I posted.
> >
>
> emails = File.open("data.txt").readlines.map! {|x| x.chomp}
> email.scan(/\S+/)

Though shalt use the block form of File.open to ensure proper cleanup!

Apart from that there is another way:

require 'set'
addresses = Set.new

File.foreach "data.txt" do |line|
  line.chomp!
  line.downcase!

  puts "Duplicate: #{line}" unless addresses.add? line
end

Cheers

robert

-- 
use.inject do |as, often| as.you_can - without end