Hi,
I’m trying to export a Julia array (of dictionaries, among some oddities) to a text file to share with a colleague.
The array in question looks something like this, but about 70k entries:
Dict{String, Any}("tem" => false, "cl" => "B")
nothing
Dict{String, Any}("tem" => true, "cl" => "AS")
Dict{String, Any}("tem" => false, "cl" => "CR")
Dict{String, Any}("tem" => false, "cl" => "EB")
So far I tried following the 2018 solution posted on a similar topic:
f = open("demo.txt", "w")
for i in eachindex(slice_array)
println(f, slice_array[i])
end
And a to-the-letter version:
outfile="demo.txt"
f = open(outfile,"w")
for i in eachindex(slice_array)
println(f, slice_array[i])
end
While both approaches do create a ‘demo.txt’ output file, the content of the file itself is empty. Testing the loop portion without the f io does seem to print all the lines in the REPL without issues.
What could I be doing wrong?
Any advice would be appreciated. Thank you!