Don't have no idea how to do it. How can I collect info to a txt file and print to terminal? I need it to output to txt file and to terminal

What you want is the tee shell function. You could emulate it with a function based on julia's print function method that allows you to specify the IO destination:
function teeprint(io1::IO, io2::IO, xs...)
print(io1, xs...)
print(io2, xs...)
end
Used this way:
fp = open("temptext.txt", "w")
lines = split("""
print([io::IO], xs...)
Write to io (or to the default output stream stdout if io is not given)
a canonical (un-decorated) text
representation. The representation used by print includes minimal
formatting and tries to avoid Julia-specific
details.
""", "\n")
for line in lines
teeprint(fp, stdout, line)
teeprint(fp, stdout, "\n")
end
close(fp)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With