Currently my function runs a for loop, and if certain criteria are met it println’s certain values into the REPL. I leave it running over night and manually copy the results into an excel sheet. This is obviously not secure and I would like to know how to save it directly into a file.
The last part of the function looks like this, which I had hoped would work.
if (sol3[(num_nutrient+num_plant+num_animal+num_vessel_types),end]) > 0.000001 && (sol3[target_species,end] > 0.000001)
open("Fish parameters 80 species.txt","a") do io #here I think "a" refers to append! because I am adding more to the file
# This is not clear in the previously linked example because the person also called what they wanted to print as a
# "Fish parameters 80 species.txt" has been previously created
println(io,"target_species: ", target_species)
println(io,"catch_max: ", catch_max2)
println(io,"scaling: ", scaling2)
println(io,"maintenance: ", maintenance2)
println(io,"P_catch: ", P_catch2)
println(io,"μ: ", μ2)
end
end
So far nothing has been written in the file and I would like to know why.