How execute in Julia this string? eval(Meta.parse()) not works

I have some code for julia from another aplication but is with some trash…

julia> output
"a=rand(2,2)\r\nprintln(a)\r\nprintln(\"podporogram wykonany\")\r\nusing DelimitedFiles\r\nwritedlm(\"a.dat\",a,
'\\t');;;;;;;;"

julia> eval(Meta.parse(output))
ERROR: Base.Meta.ParseError("extra token after end of expression")
Stacktrace:
 [1] #parse#4(::Bool, ::Bool, ::Function, ::String) at .\meta.jl:169
 [2] parse(::String) at .\meta.jl:164
 [3] top-level scope at none:0


How execute this string in Julia ? In fact this sample is correctly like this :

a=rand(2,2)
println(a)
println("finished")
using DelimitedFiles
writedlm("a.dat",a,'\t');;;;;;;;

Paul

julia> include_string(Main, "a=rand(2,2)\r\nprintln(a)\r\nprintln(\"podporogram wykonany\")\r\nusing DelimitedFiles\r\nwritedlm(\"a.dat\",a,
       '\\t');;;;;;;;")
[0.386343 0.511984; 0.826547 0.717828]
podporogram wykonany
2 Likes