Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

read real data in .txt ?

0 views
Skip to first unread message

Emmanuel Harel

unread,
Feb 20, 2001, 5:39:34 PM2/20/01
to
Hello
I want to read real data in a txt file for example I wrote :
real*8 X
open(10,file='file.txt',status='old')
read(10,*) X

txt file contains for example : 0.4.
0.2.
.
.
.
When I execute the .exe I got the message : run time error F6103 :
read(file.txt)
-
Invalid REAL

What can I do ?

Richard Maine

unread,
Feb 20, 2001, 6:41:11 PM2/20/01
to
"Emmanuel Harel" <emmanue...@free.fr> writes:

Might be more clear if you showed us *EXACTLY* what a sample text
file contains, instead of a "for example" with ellipsis. I'm having
trouble telling from what you posted. Does the text file really
start with "0.4." or is that second point supposed to be part
of an ellipsis in your "for example"? If there is really a second
decimal point there, then that would be a problem - a real
number may have only one decimal point.

Also, there is something a bit odd looking about the formatting of
your "for example" text file. You don't perhaps have something
non-standard like tab characters in it do you? Or perhaps lines
that aren't properly formed for DOS/windows (i.e. don't end in a
cr/lf). Based on the fact that you mention exe files, I am guessing
that you are on dos/windows.

--
Richard Maine | Good judgement comes from experience;
ma...@altair.dfrc.nasa.gov | experience comes from bad judgement.
| -- Mark Twain

0 new messages