[Classiccity-pm] basic idiot question

Jeff Scarbrough rail at uga.edu
Sat Oct 25 19:51:48 CDT 2003


At 06:02 PM 10/25/2003 -0400, you wrote:
>On Sat, 25 Oct 2003, Jeff Scarbrough wrote:
>
> > All of the data from the various files for a given minute needs to be on
> > one line...I'm not sure if cat and sort could do that - could it?
> >
>
>I don't think so, at least not easily.  Sorry I didn't realize that all
>the data needed to be one one line.
>
>You could cat | sort them into one file to make the parsing easier
>though..

OK, between the suggestions you and Mark put forth, I think I'm on to 
something...

So far I've got a program that will read each file in turn, generating a 
time stamp (DOY, for Day Of Year) for each line of data based on month, 
day, hour, minute on the fly.  The DOY is used for a key to an element of a 
hash which is the line of data.

So, now I've got one hash for each file, and I ~think~ I know how to get an 
array of keys...

Next trick is to merge the arrays of keys, eliminate duplicates, and sort 
into numerical/chronological order.  Then I can write a line consisting of 
the key (the DOY) and the lines of data from each file that match that key, 
or blank spaces if there is no data in one or more of the files.

The part I need to learn now is how to do the cat |sort...back to Mr. 
Google's Laboratory...

Thanks,
Jeff 




More information about the Classiccity-pm mailing list