Hi all,
I have a text file containing data like :
2.2*cos(pi*25/16), 2.2*sin(pi*25/16)
2.2*cos(pi*23/16), 2.2*sin(pi*23/16)
2.2*cos(pi*7/16) , 2.2*sin(pi*7/16)
...
I would like to read these data and store them as numbers (means interpreting them while reading) not as text.
Any way of doing this easily?
EvoArt
#2
Not something I’ve done. But parse seems to be the direction to go in
johnh
#3
In the REPL
julia> eval(Meta.parse(“2.2cos(pi25/16)”))
0.4291987084354823
I guess I would use CSV.jl to read the lines then parse the expressions like that?
Great, it works perfectly. Thanks 