Skip to main content
Question

Logging to a log file -new line problem

  • August 16, 2019
  • 2 replies
  • 11 views

I use the below items

* Use an attributeFileWriter

* Use a dynamic string built up eg -----------------------------------2019-08-14 15:18->Roads in gdb:37574----------------------------------------------------------------------2019-08-14 15:18->Roads in gdb with duplicate removed:37572----------------------------------------------------------------------2019-08-14 15:18->Roads in SDE::37474----------------------------------------------------------------------2019-08-14 15:18->Roads in SDE with duplicate removed:37454-----------------------------------

* I log into a txt file

* After every ----------------------------------- I have a new line inserted

 

Problem-

* When I open the text file, why don't I see the line feeds as I inserted them

 

Cofusion-

* when I copy/paste the contend into a rich editor eg browser, Word I can see the line feeds

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

redgeographics
Celebrity
Forum|alt.badge.img+60
  • Celebrity
  • 3701 replies
  • August 16, 2019

It may depend on encoding, your operating system and which text editor you use to check it.

What works for me (on a Mac) is using an AttributeManager to add a newline at the end of the attribute before writing it to the log file with the AttributeFileWriter.


  • Author
  • 15 replies
  • August 19, 2019

I get it correctly in "Notepad++" but not in "Notepad"

I believe the answer is in the encoding, "System.default" is what I set