comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeff C," <jcreem@yahoo.com>
Subject: Re: Reading text files with different data types
Date: Mon, 10 May 2004 02:21:58 GMT
Date: 2004-05-10T02:21:58+00:00	[thread overview]
Message-ID: <aHBnc.59484$0H1.5924527@attbi_s54> (raw)
In-Reply-To: 6e837805.0405091609.bb1a850@posting.google.com

Assuming you have been taught about generics, look at

Text_IO.Float_IO
which is generic and can be instantiated for any floating point type.

It can read floats from a file or from a string.

You can mix calls to this with standard text_IO stuff for the text data.


"Isa" <yorkbiatch@hotmail.com> wrote in message
news:6e837805.0405091609.bb1a850@posting.google.com...
> I'm trying to write a program to read points from a text file into an
> array of records.
> Each record corresponds to a line in the file, consisting of an
> alphanumberic 6 character line, a space, a floating point number,
> another space, then a final floating point number. (a name and 2
> coordinates).
>
> I'm completely at a loss as to how to read this in -- Ada.text_IO can
> read it fine as a string - but I need to do calculation on the
> floating point numbers(which could be with or without decimal points,
> largest number to be stored  1000.00)
>
> I don't think I can use streams - as it *must* be a text fine that is
> read in, not a binary file.
>
> Can anyone help me? I'm not asking for code - I just need a shove in
> the right direction....
>
> Thanks....any help will be VERY gladly appreciated





  reply	other threads:[~2004-05-10  2:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-10  0:09 Reading text files with different data types Isa
2004-05-10  2:21 ` Jeff C, [this message]
2004-05-10  5:41 ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox