[Lazarus] reading FORTRAN-style input in Lazarus
Mark Morgan Lloyd
markMLl.lazarus at telemetry.co.uk
Fri Aug 5 10:55:39 CEST 2011
Lukasz Sokol wrote:
> On 05/08/2011 05:49, David M. Lawrence wrote:
>> The values aren't always separated by spaces. These are huge files
>> with sometimes tens of thousands of lines of data. The only way I
>> can effectively search and extract relevant data form them is to find
>> a way to specify that characters 1 through 3 are a country code,
>> characters 13 through 37 are site names, etc.
>>
>> Dave
>
> So this is some kind of address database ?
> Any real-world example you could provide with different field separators ?
> (data may be dummy, of course)
A few months ago I was reading lots of SNMP MIBs (sming format), and
wrote a parser using a Meta-2 derivative. However in the general case,
and particularly for line-oriented input, it's probably a job for either
regexes or an (as yet unwritten) equivalent to format() etc. However,
error recovery (when a line departs from the accepted format part-way
through) is not going to be easy.
What scripting languages can be embedded in FPC/Lazarus these days? If
an embedded language was called for each line would the overhead be
excessive?
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
More information about the Lazarus
mailing list