- #1
chemengstuden
- 6
- 0
I'm trying to input a .txt file with a variable number of rows and 3 columns into an array. The first row is just a single number expressing the remaining number of rows. so we have something like this
3
3 5.12 3
5.3 3 5
4 3 4
All the individual numbers are separated by spaces. So far I got something like this
Read(10,*)a
do while (io== 0)
read(10,*,iostat=io)array1
end do
write(*,*) a
write(*,*)array1
With "a" being a variable that contains the first number. The array fills up with the second part but the sig figs are messed up.
3
3 5.12 3
5.3 3 5
4 3 4
All the individual numbers are separated by spaces. So far I got something like this
Read(10,*)a
do while (io== 0)
read(10,*,iostat=io)array1
end do
write(*,*) a
write(*,*)array1
With "a" being a variable that contains the first number. The array fills up with the second part but the sig figs are messed up.