Re: help on creating a mean array of data [message #45949] |
Mon, 24 October 2005 11:09  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
pimpk24@hotmail.com wrote:
> perhaps my original post was a little misleading and oversimplified.
> but what iam dealing with are several large '.dat' file in which there
> are multiple columns and number of rows of data varies with each file.
> Also each 'day' of data is not physcially seperated. perhaps this is
> better this is a better representation:
>
> temp1a dewp1a pressure1a *where 1,2,3 etc represent data at
> different levels in
> temp2a dewp2a pressure2a the atmosphere and a,b,c etc
> represent different days
> temp3a dewp3a pressure 3a
> temp1b dewp2b pressure 1b
> temp2b dewp2b pressure 2b
> temp3b dewp3b pressure 3b
> the number of columns of data in each file is standard but the number
> of columns is not known and can vary.
Ummm. Did you mean the # of *rows* can vary? Or do you mean that there
can be any number of columns between files, but within a file the # of
columns is fixed? I'm assuming you mean rows...
> Hence would i still be able to
> use the matrix approach you described along with something like a
> 'while(eof)' loop? Or should i take an altogether different approach?
Both would work. You can use the FILE_LINES function to determine the #
of rows and then use the matrix approach. Or you can used a while (not
eof()) loop and process the file line by line. I generally do the
former when my data is arranged logically in the file, or the latter
when data is "mixed-up" and I want to re-arrange it in memory.
In your case, I would probably use the while loop and calculate the mean
as I was reading in data.
-Rick
|
|
|