reading a number in a file
reading a number in a file
(OP)
Hallo everybody,
I would like to know how can I take a value from a text file like this in fortran:
text
number text number
output
1 3.4556 4.55555
2 3.2222 3.00000
text numbers
numbers ecc...
How can i do if I want to search for the value 3.000?
thanks,
Albert
I would like to know how can I take a value from a text file like this in fortran:
text
number text number
output
1 3.4556 4.55555
2 3.2222 3.00000
text numbers
numbers ecc...
How can i do if I want to search for the value 3.000?
thanks,
Albert
RE: reading a number in a file
RE: reading a number in a file
I have to read an exponential number in fortran:
3.435335355E-02
I try to read it with a E format but It gave me some problems,
Thanks,
Albert
RE: reading a number in a file
I have to read numbers like this:
366 6.0898E-03 0.000
367 5.9922E-03 0.000
368 5.8798E-03 0.000
369 5.7485E-03 0.000
370 2.1932E-02 0.000
371 2.1872E-02 0.000
372 2.1733E-02 0.000
373 2.1471E-02 0.000
374 2.1132E-02 0.000
375 2.0666E-02 0.000
376 2.0127E-02 0.000
377 1.9461E-02 0.000
378 1.8727E-02 0.000
379 1.7886E-02 0.000
380 1.6991E-02 0.000
the second column sometimes has e-02 and sometime e-03 I'm trying to use e format but it gave me differents numbers do you know how can I do?
Thanks again,
albert
RE: reading a number in a file
Surely a free format read statement can be used here:-
Read(5,*)I,A,B
will happily read each line of your file
RE: reading a number in a file
thanks a lot is working!!
albert