HELP! how do i read in multiline data blocks?



Hi. I hope some kind soul would be able to help me out. Have been
spending days reading manuals on load, textread, textscan, dlmread,
fgetl, etc., and trying out various things, but I am not succeeding.


I need to read in about a month's worth of data from an acoustic
sounder, with one day of data per file. The datafiles I'm trying to
read have blocks of the following format repeated for each 15 minutes
time interval (i.e. at most 96 blocks per file):

BL# MONTH DAY YEAR HOUR MIN VAL1 VAL2 VAL3 VAL4
0 5 12 2005 0 15 1666 1023 1531 0

SPU1 SPU2 SPU3 SPU4 NOIS1 NOIS2 NOIS3 NOIS4 FEMAX SOFTW
2 3 1 0 381 381 364 0 63 8173

FE11 FE12 FE21 FE22 SNR1 SNR2 SNR3 SNR4 CHECK JAM
9 9 9 9 96 96 103 0 248 -9999

ALT CT SPEED DIR S DIR W SW SU SV INVMI AU
AV AW

500 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999
450 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999
400 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999
350 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 856
216 527
300 111 368 223 21 -4 55 60 112 -9999 676
704 299
250 126 283 227 15 -3 32 61 72 -9999 693
875 379
200 148 253 223 13 3 24 40 54 -9999 237
736 484
150 183 215 218 13 8 21 40 48 150 253
481 407
100 233 257 219 9 13 23 39 40 100 297
381 423
50 239 233 219 11 25 21 42 44 161 431
247 471
$

_____________________
[sorry about line-wrapping, the lines in the data block are rather
long, but I think the pattern is visible]

Basically there are of of the following:
ONE HEADER LINE
ONE LINE OF TAB SEPARATED DATA
ONE EMPTY LINE

Then there is
ONE HEADER LINE
ONE EMPTY LINE

and then
10 lines of 13 columns.

and then a '$' signaling the end of the data block.

I know I want a loop that goes through one datablock at a time,
assigning the each datapoint data inside block n to position n in a
vector that collects all the data. But I'm very confused about how I
can build the interior of such a loop.

Any help would be highly appreciated!

Thanks a lot.

Arnico.
.



Relevant Pages

  • Re: how I could extract information from text?
    ... dpb wrote: ... fgetl() as many times (maybe a loop?) as header lines of no interest ...
    (comp.soft-sys.matlab)
  • Re: Home made mail news search tool, and folded header lines
    ... more clarity by declaring the loop control variable in the loop control. ... pronounce the identifier aloud, once. ... > They should be the same if all regs have hit at least once. ... undefs or empty strings if a header line of interest is not present. ...
    (perl.beginners)
  • Re: TRUE and FALSE values in the relational lattice
    ... E * E: natural join ... the relation with empty header and a single empty tuple ... the equality relation with header ... So the syntax becomes: ...
    (comp.databases.theory)
  • Re: Header/Footers COunting Fields
    ... For Each oStory In ActiveDocument.StoryRanges ... Loop Until oStory Is Nothing ... I have 4 fields inside a header, 15 in the document and one in the footer. ...
    (microsoft.public.word.vba.general)
  • Re: Noob Questions [arrays]
    ... A loop that is not a .each loop that reads in user input ... until the input is an empty line ... puts 'type words one at a time and I will alphabetize them for you.' ... to the empty string before entering the while loop. ...
    (comp.lang.ruby)