Reputation: 511
I have a C app that logs to a file.
I installed the monitor plugin for notepad++ to automatically update, similar to 'tail' on Linux.
My app writes the lines with \n\r at the end ( e.g. fprintf(fp, "%s\n\r","Test"); )
I get something like:
Line 1
Line 2
instead of
Line 1
Line 2
When viewing (no matter the EOL conversion) with 'View->Show Symbol->Show End of Line' I see:
Line 1[CR][LF]
[CR]
Line 2[CR][LF]
[CR]
It is as if it is treating \n as a [CR][LF] and \r as [CR] which is adding another line.
Any ideas?
Upvotes: 2
Views: 4487
Reputation: 346
I think the problem isn't clear from your description, The title suggests that you have problem with the NPP but your explanation shows that you have problem with the App Code.
for NPP: You can remove those extra new Lines from the file.
for App: If you are strictly going with Windows O.S. then use just '\n' or else if you are using other O.S. also then first find out the new line character for that O.S. and apply that.
Upvotes: 2
Reputation: 1851
The escape sequences may be os-dependent on the , as I heard some months ago.
So, the \n in this case seems to cover both .
I Would experiment with the escape sequences.
But prior to that : Have a look inside fp.... there could also be some sequences.
Upvotes: 0