in reply to Re: Lost contents of arrays...
in thread Lost contents of arrays...
An example of the dataset is provided in the parent node of that thread. And a description of my proposed solution is provided within that thread as well.
The solution will need to be reworked a bit if the assumptions I made (and documented) in my original solution aren't accurate. In particular, I would be concerned with how records are delimited, and the exact order of lines within each record. But with those caviets, the solution should work as long as the user massages it to find the right line within each record.
If I had the solution to write again, given the ambiguity of the original dataset, I might grep each record to find the element on which the sort criteria is based, instead of indexing into is (which assumes a fixed and known position). Then I would split the results of the grep and build my ST data-structure in that way. It would be slower to set up each ST (because grepping a six-element record is slower than indexing its 4th element), but it would be more robust and less likely to break if records change size in the future.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Lost contents of arrays...
by Anonymous Monk on Jan 18, 2004 at 20:49 UTC | |
|
Re: Re: Re: Lost contents of arrays...
by CountZero (Bishop) on Jan 18, 2004 at 20:13 UTC |