Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating text files

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
I am using fputs() to write strings of data to a text file. I am able to create the file but, for the life of me I cannot get the NL/CR.

When I open the file using notepad, the content is a very long single line.

What gives?

I have tried using \n, chr(10) and chr(13) ... none of them work.

I am running on WIN 2003 based server ...

thanks,
 
I believe Windows needs the \r\n characters to denote line breaks.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
terminate each line ending with \r\n. remember to enclose them in double quotes and NOT single quotes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top