save generated text in file