To create a file in Julia


#1

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


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

See the docs
https://docs.julialang.org/en/v1/manual/networking-and-streams/


#3

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)