From: Snoopy Dog Date: 2006-09-16T07:44:40+09:00 Subject: Re: File Merge help request from Newbie Pit Capitain wrote: > Snoopy Dog schrieb: >> (... merging data of two files ...) > > Snoopy, if your data is as well structured as you've shown (minus a few > typos), merging the data of two files should simply be: > > data = File.readlines(path) > additional_data = File.readlines(second) > > data.concat(additional_data) > data.uniq! > data.sort! > > # write data to destination file > > Regards, > Pit Thank You Pit. I implemented this in minutes following your example. The data is very well structured, unfortunately the data is not identical between suppliers. Sometimes there are differences in prices or volumes fields. So now I get unique records, but some have the same date. Since I use the data as a time/price series, I can't have duplicate dates. Unfortunately I don't have time to work on this tonight, but will keep at it. Thanks. Snoopy -- Posted via http://www.ruby-forum.com/.