Saving root output in txt file