Hi Chris
I think the biggest issue is the difference between File.read and
IO.readlines, and understanding when an array or a string is returned. 

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. What I do now, is get the latest data, put the
existing file into an array, merge the two and hack it with
Array.sort.uniq, truncate the file and insert the new data.

Anyway, as I said, off topic so don't worry too much - this solves a
sort-term problem.

Kind regards
Walter

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris McMahon
Sent: 16 April 2007 06:11 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] [OT] - array nightmare

> The new array replaces all the data previously in the master log file.
I get
> a lot of redundant whitespace for some reason. It really is a hack -
there
> must be a better way to do it...
>

I'm not sure what the expected result here should be.  Seems like a
reasonable approach.  What part is the hackiest?
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
**************************************************************************************************************************
Everything in this e-mail and attachments relating to the official business of 
MultiChoice Africa is proprietary to 
the company. Any view or opinion expressed in this message may be the view of 
the individual and should not automatically 
be ascribed to the company.  If you are not the intended recipient, you may not 
peruse, use, disseminate, distribute or 
copy this message. If you have received this message in error, please notify 
the sender immediately by email, facsimile 
or telephone and destroy the original message.
**************************************************************************************************************************
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to