Saving .txt files or to a txt file

Can this be done, my project is for use offline. Any tuts or expamles would be great.