I have approximately 1000 pieces of simulation data which have 2D array and size of the array is 1000(Row), 7(Col).
First, I tried to import and export the array just to see calculating speed and I programmed as below.
Input data structure
SIMULATION RESULTS
0.599566E+00 0.666925E-06 0.3348E+02 0.2527E+03 -0.6948E+04 ...
0.599633E+00 0.666924E-06 0.3394E+02 0.2529E+03 -0.6949E+04 ...
0.599699E+00 0.666922E-06 0.3424E+02 0.2528E+03 -0.6949E+04 ...
0.599766E+00 0.666920E-06 0.3440E+02 0.2527E+03 -0.6949E+04 ...
0.599833E+00 0.666919E-06 0.3460E+02 0.2525E+03 -0.6948E+04 ...
0.599899E+00 0.666919E-06 0.3488E+02 0.2522E+03 -0.6948E+04 ...
0.599966E+00 0.666919E-06 0.3530E+02 0.2520E+03 -0.6948E+04 ...
.
.
.
first try
using Glob
filename = glob("*.dat*")
for i in filename
data = readdlm(i, Float64, skipstart=1)
writedlm("new_"*i, data)
end
close(data)
second try to keep specific format
using Glob
filename = glob("*.dat*")
for i in filename
data = readdlm(i, Float64, skipstart=1)
m = (a->(@sprintf "%15.3f" a)).(data)
writedlm("new_"*i, m, "" , quotes=false)
end
close(data)
But the problem is that the calculating speed is very slow.
So, Please give me some advises so that I can deal with array data much faster (let me know if I don't
follow the Julia style and teach me some better way please.)