To create a file in Julia


Hi! One problem. How do I create a text document and write data to it?

io = open("/path/to/file.txt", "w")
println(io, "some text")

See the docs


Depending on what you want to write, maybe even just

julia> x = rand(2,2)
2×2 Array{Float64,2}:
 0.126405  0.14943
 0.260247  0.415338

julia> using DelimitedFiles

julia> writedlm("x.txt", x)