Re: The concept of a record



qsc wrote:

After reading Gordon and Klaus's replies, I came to the
> conclusion that write(12) U(:) will write all the values
> in U(:) as one record. But the concept of "line" doesn't
> apply here.


If I am correct in the statement above, then what will be
the structure of the data file? Or put in another way, after
writing the array into an external data file, I load the
data file using fread of matlab. The function fread will
> produce a data matrix. What will be the shape of the matrix?
Is it (1,N), or is it (N, 1), or something else?

All the data from one UNFORMATTED WRITE statement goes into
one record. The shape, if any, does not.

REAL A,B,C,D,X(4)
DATA A,B,C,D/1.,2.,3.,4./
WRITE(1) A,B,C,D
WRITE(1) A,B,C,D
REWIND 1
READ(1) X(1:4)
WRITE(*,*) X
READ(1) X(3:4),X(1:2)

You can read or write with separate scalar variables, arrays, array
elements, implied DO over any of the above, all goes into one record.

Systems may have a record length limit, and even if they don't it
might require a buffer the size of the record to be written.
Small records may have excess overhead, very large ones might
have other types of overhead.

-- glen

.



Relevant Pages

  • Re: oocalc does not directly import .dat files
    ... > First row contains the first array, second row contains second array, ... gnuplot supports plotting only columns. ... > So now I have to find a software which will transpose the data file. ... > thought oocalc can do it. ...
    (Debian-User)
  • Re: Counting the Dates
    ... So you start reading the data file, adding up all the values that fall on ... you should have an array that has the total value for January ... the data has already been loaded into a DataArray() ... store the totals in a separate location so that I can reference them ...
    (microsoft.public.vb.general.discussion)
  • oocalc does not directly import .dat files
    ... First row contains the first array, second row contains second array, ... But if I want to visualize this data using gnuplot (my favorite plotting ... So now I have to find a software which will transpose the data file. ... But my data files usually have a .dat ...
    (Debian-User)
  • Re: Need Help deleting record from text file
    ... Who said you need to read an entire array into memory just to access a small portion of it? ... If you write the data in a suitable format you can later open the data file by reading just a relatively small header chunk and then read in the elements or the portion of data you require. ... How is using a database going to speed up that operation! ...
    (microsoft.public.vb.general.discussion)
  • Re: Counting the Dates
    ... calendar date, excluding weekends and holidays. ... So you start reading the data file, adding up all the values that fall on ... you should have an array that has the total value for January ... (In case I'm not making sense: I want to add up all the values found under ...
    (microsoft.public.vb.general.discussion)