Writing Strings To Text Files
- Posted by Monty King <boot_me at GEOCITIES.COM> Oct 12, 1998
- 571 views
Chris Cox wrote: >Since then, I've been looking >for a way to write the contents of a string >to a text file. Jay Turley Wrote: >printf(fn,"%s ",{s1}) >printf(fn,"%s\n",{s2}) Here is another solution: My understanding is that puts() is a way of putting a string to a file...can't you just put puts(fn,string) and have it write the entire string to that device? I am thinking that you can...it is harder sometimes to read stuff in than to write... The first thing is to get the fn to write to. That is done with Jay's line fn = open("c:\\myfile.txt","w") fn being the fn that puts will use... and the "w" being write to file... Hope this helps... Monty in Oregon.