append line.
-
Hi, I want to append line to file i tried like this: CString strNewWord (_T(" Test line to write")); CStdioFile file; file.Open(strSystemPath,CFile::modeWrite|CFile::modeNoTruncate,NULL); file.SeekToEnd(); CString strWriteData("\\n "); strWriteData+=strNewWord; file.WriteString(strWriteData); file.Close(); this code appends data but in single line (assume no compile time errors): \n Test line to write\n Test line to write\n Test line to write I want like this: Test line to write Test line to write Test line to write
-
Hi, I want to append line to file i tried like this: CString strNewWord (_T(" Test line to write")); CStdioFile file; file.Open(strSystemPath,CFile::modeWrite|CFile::modeNoTruncate,NULL); file.SeekToEnd(); CString strWriteData("\\n "); strWriteData+=strNewWord; file.WriteString(strWriteData); file.Close(); this code appends data but in single line (assume no compile time errors): \n Test line to write\n Test line to write\n Test line to write I want like this: Test line to write Test line to write Test line to write
CString strNewWord (_T(" Test line to write")); CStdioFile file; file.Open(strSystemPath,CFile::modeWrite|CFile::modeNoTruncate,NULL); file.SeekToEnd(); CString strWriteData("\n ");/*(Here you ve gone wrong no need to give "\\n" for a new line just "\n" is enough)*/ strWriteData+=strNewWord; file.WriteString(strWriteData); file.Close(); Use this code this will be working . :-D
Thanks & Regards VIJITH VIJAYAN
-
Hi, I want to append line to file i tried like this: CString strNewWord (_T(" Test line to write")); CStdioFile file; file.Open(strSystemPath,CFile::modeWrite|CFile::modeNoTruncate,NULL); file.SeekToEnd(); CString strWriteData("\\n "); strWriteData+=strNewWord; file.WriteString(strWriteData); file.Close(); this code appends data but in single line (assume no compile time errors): \n Test line to write\n Test line to write\n Test line to write I want like this: Test line to write Test line to write Test line to write
You were answered a few lines down. Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...