> I'm not comfortable with truncating the original file either. What I
> would like to do is get the latest data, see what's not in the main
> file, and append it.

I'm reading this sentence as a set of requirements.  Assuming that the
arrays are small enough to not blow out the RAM on the machine, I'd do
it like this:

##########################

main_file = ['a','b','c',' ']
latest_data = ['c','x']

not_in_main_file = latest_data - main_file
puts "not in main file: "
puts not_in_main_file
puts ""

new_log = main_file + not_in_main_file
puts "new log contents after addition: "
puts new_log
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to