On 9/16/06, Snoopy Dog <snoopy.pa30 / gmail.com> wrote:
> As I am new to Ruby, and regular expressions, I implemented Pit's
> method.  Since I have some issues with the data (values, not structure)
> both your's and Pit's methods have the same data issues (DATE not
> unique).
>
> I think I will be able to use your regular expressions to split up my
> incoming data and find a way to use the unique feature on the date
> value.

I'd do something like this:

require 'enumerator'

data = File.readlines(path)
additional_data = File.readlines(second)
data.concat(additional_data)

data.sort!
mergeddata = [data[0]]
data.each_cons(2) {|x1,x2| mergeddata.push(x2) unless x1.split(/,/)[1]
== x2.split(/,/)[1]}

Sam