How would you do this in Perl?

Bes

Bes

Soldato
Joined
18 Oct 2002
Posts
7,318
Location
Melbourne
Hi

I need to write a script that reads through x log files that look like this:

<Date><Time> <Data>

I need to merge the log files together so that I get something like this in a 2D array:

<Epoch value> <data_file1> <data_file2> <data_file3> <data_file4> etc etc <total (All data_file values for that epoch value added together- this one doesnt have to be in the array but is ultimately what I want.>

Now writing the code should be easy but conceptually, I cannot figure out how I would get everything into a nice array (i.e. I have to open each file, read everything out into my script, match up the times, and have a single array with everything).

The thing is the number of data files can change, and I need to write the script in a way that will allow it to always maintain the above structure.

Any psuedo code anyone can write to help me would be appreciated :)

Thanks
 
Back
Top Bottom