Problem when recording with append mode

new topic     » topic index » view thread      » older message » newer message

For some reason that does not matter here, some programs write files without '\n' in your last line. Thus, the file looks like this:

Line 1\n 
Line 2\n 
Line 3 

When I open the file with the statement: open ("filename", "a") and record more lines, the result is:

Line 1\n 
Line 2\n 
Line 3Line 4\n 
Line 5\n 

Simply use a '\n' before starting the recordings is not solving also, because there are files that comes with '\n' at the end, and in this case the result would be this:

Line 1\n 
Line 2\n 
Lane 3\n 
\n 
Line 4\n 
Line 5\n 

How do I resolve this issue?

Thanks in advance

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu