hi everyone,
i have a file that i want to parse. i’m used to doing this stuff
recursively, and would like to know what the “ruby” style would be. the
file is a series of tests, with the test name at the :start and the test
parameters listed afterwards. here’s an example, though the complete
file
is much longer:
:start Perf_Video_Integrity
Sample_Rate 44100 :default 48000 88200 96000 176400
192000
:end
:start Perf_Video_Integ_Play
Session_Name :default SessionName
HW_Buffer_Size :default All 64 128 256 512 1024 2048 4096
8192
Play_Time_Minutes :default 20
testType :default SPDIF ADAT
:end
:start Perf_Video_Integ_Rec
Session_Name :default SessionName
HW_Buffer_Size :default All 64 128 256 512 1024 2048 4096
8192
Rec_Time_Minutes :default 20
:end
currently, i have the file in an array of lines. i’d like a function to
find the specified test (i.e. Perf_Video_Integrity), and return an array
of
the parameter lines. my specific question is, what is the most elegent
way
to build the control structure that extracts the relevant lines?
any advice is appreciated.
-reid