Skip to content

faq 297566213

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

Mixed Line endings in Plans file, on Windows

by John O on 2018-06-29 09:40:14


When running Matsim on Windows, the plans file written contains lines with both Unix (Lf) and Windows (CrLf) line endings because the attributes are written out in a different way (the correct one) from the rest of the information. This is true in 0.9.0 and seems to be the case in the current snapshot too.

org.matsim.utils.objectattributes.attributable.AttributesXmlWriterDelegate.writeAttributes()

uses: writer.newLine()

which writes the newline for the given operating system,

while

methods in org.matsim.core.population.io.PopulationWriterHandlerImplV6

use: out.write("\n");

which outputs just an Lf, regardless of the operating system.

This is fine for Unix-like systems but on Windows, the file has mixed endings.


Comments: 1


Re: Mixed Line endings in Plans file, on Windows

by Kai Nagel on 2018-08-05 13:19:11

Thanks for the note. I put it into https://matsim.atlassian.net/browse/MATSIM-843 . Might take some time to fix this since "\n" for line endings is a normal convention for many of us. But I agree that this is not good, and even worse when it is in the same file.

Clone this wiki locally