How to convert following simple Fortran to Julia?
integer n,i,ne,m,k(10,2)
real x(10),a(10)
open(1,'t.txt')
READ(1,*) n,ne
do i=1,n
READ(1,*) m,x(m)
end do
do i=1,ne
READ(1,*) m,a(m),(k(m,j),j=1,2)
end do
end
The contents of file t.txt could be
4 3
2 4.1
3 2.2
4 7.1
1 1.1
2 3.3 1 4
3 4.4 2 4
1 7.7 1 2
I'm old Fortraner. I made several attempts using readline without any luck..
I finally found a solution by using combination of 'split' and 'parse' functions to read the group of input data and assign them to variables. Reading such type of data though isn't as easy, direct and clear as in Fortran..