[Lazarus] reading FORTRAN-style input in Lazarus

Alexander Klenin klenin at gmail.com
Fri Aug 5 06:58:34 CEST 2011


On Fri, Aug 5, 2011 at 15:49, David M. Lawrence <dave at fuzzo.com> 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.

PLEASE to do not top post.
You are out of luck then.
A small help may be to declare a record:
type
  TInputLine = packed record
    CountryCode: array [1..3] of char;
    FloatValue: array [1..10] of char;
    Separator1: array [1..2] of char;
    ...
    Eoln: array [1..2] of char;
  end;
and then read you file as "file of TInputLine".
This way, you will not need to split the line manually,
only to convert numeric fields from strings.

-- 
Alexander S. Klenin




More information about the Lazarus mailing list