Sorry for another stupid question. I have a file called Yji.txt, contents is listed below,
3.29107948 3.01222513 1.81928273 1.73277408 1.01205782
3.79643512 3.12969360 2.72422926 1.99088313 1.37971501
2.20058980 2.03869455 2.01194312 1.25660107 0.85350759
3.27627114 2.36889134 2.07543404 1.40830475 0.84922031
3.06670541 2.77976809 1.96303171 1.71966277 1.26711606
3.52942983 2.42193693 2.05404920 1.48999137 0.83146491
3.37109577 2.41969083 2.02905938 1.50383911 0.74416147
4.34400391 3.91427909 3.71031537 2.20110125 1.78240591
3.39792241 2.30627896 2.24137999 1.52784113 0.85893251
2.63109783 2.38360933 1.92420508 1.17364141 0.73957600
It is 10 lines, each line have 5 elements which are all Float64.
Each of the line, the Float64 numbers are generated by Fortran or Matlab with the format,
5(f12.8,1x)
means (f12.8,1x) is repeated 5 times.
Each of the f12.8,1x means that, the values took 12 space, and 8 of them are occupied by digits, as you can see, they all have 8 digits. The 1x means the values are separated by an additional space.
Anyway, those values are in a txt file called Yji.txt. I am sure Julia is smart enough to read the format automatically.
Now, I want to do the following,
I have an array a=Array{Float64,2}(undef,10,5) ,
a[i,:] should store the 5 values at line i.
a = Array{Float64,2}(undef,10,5)
for ln in eachline("Yji.txt")
I need i to represent line number
a[ i, : ] = I need to convert ln to the corresponding 5 Float64 numbers, so that they can be stored to a[i,:]
end
How to do that?
I read the βeachlineβ, and βreadβ in Julia document, and googled a little though did not google very hard, but still not very clear, could anyone give some hints?
Sorry for the stupid question.
Thank you very much in advance!