Hmm..
My fortran comipler is gfortran so it should work.I've made some changes to the code:
program vol_aqua
implicit none
real:: length,width,height,volume
character(8) :: name
open (1,FILE='data02.txt',status='old')
read(1,'(A10,F10.2)') name,height...
It doesn't work.When code looks like this:
program vol_aqua
implicit none
real::height,lenght,width,volume
character (8) :: name
OPEN (1,FILE='data01.csv',status='old')
read(1,*) name,height
read(1,*) name,lenght
read(1,*) name,width
volume=(height*lenght*width)/1000...
Now i'm thinking that there's got to be a way to read variables even when data file (data.csv) looks like this
height 100.0
lenght 80.0
width 90.0
How to read only numbers?
Ok:)now i know what you meant but i've done it before and there was the same problem.
Now data file looks like this:
100.0 height
80.0 lenght
40.0 width
and it doesn't help.
Maybe the problem is due to a file itself because first i'm creating 'data01' as an excel file and just then i'm saving...
Sorry but i don't get it."Height" is not a real numer and "volume,width,lenght" are?
If "height" is not a real number then should it be integer (?) - but if so should't words "width,lenght" be integer also and word "volume" real?
I'm confused.
Hi all,
and thanks for preview help but another problem occured.I've wrote a code which looks like this:
program vol_aqua
implicit none
real::,lenght,width,height,volume
OPEN (1,FILE='data01.dat',status='old')
read(1,*) height
read(1,*) lenght
read(1,*) width...
It's me again
I found a program which writes 100 columns with numbers.Now i would like to do the same but write columns with leters like A,B,C
PROGRAM tst
IMPLICIT NONE
INTEGER i,imxcol
CHARACTER varfmt*13
imxcol=99
varfmt='(XXX(E20.10))' !i've tried to change E20.10 on A10...
Thank you all for help:)
I've got one more question and please correct me if I am wrong.In the instruction "fmt" means format and "varfmt" is a name of format created by user.Is that correct?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.