Page 1 of 1
Cartridge Return & Line Feed
Posted: Wed Feb 21, 2018 9:05 am
by Dag-Are.Trydal@nov.com
When saving a file (using
fclose(f)) where I have used only "\\n" as newline I get
CRLF in the file.
But when saving an XML (using
xmlDocumentToFile(docNum,fileName)) it is saved with only
LF.
How can I save the XML file with both CR and LF?
Re: Carriage Return & Line Feed
Posted: Fri Feb 23, 2018 4:35 pm
by Gertjan van Schijndel
Why do you need also the carriage return in the xml file?
In your image the editor seems to also handle it without the carriage returns.
Re: Cartridge Return & Line Feed
Posted: Mon Feb 26, 2018 10:47 am
by Dag-Are.Trydal@nov.com
The reason is that some service personell have to edit this settings-xml from time to time. And windows nodepad (not notepad++) displays it on one line when it is only LF.

Re: Cartridge Return & Line Feed
Posted: Mon Feb 26, 2018 5:49 pm
by Gertjan van Schijndel
Could the service personnel not use wordpad (without word wrap)?
Re: Cartridge Return & Line Feed
Posted: Tue Feb 27, 2018 8:29 am
by mkoller
Following Ideas (I'm not on windows so I did not test it):
- When the personell uses WinCC_OA itself to edit the file, you could try the CTRL function textEditor() instead
- When this does not work, try using xmlDocumentToString() and then do a
f = fopen(name, "w"); fprintf(f, "%s", theString); fclose(f);
I assume this will create CRLF on windose