Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

APPENDING A NEW LINE INTO A STRING FILE

 
Anthony Yulo
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i'm appending to the text file... the text that i inserted appears after the last character of the file... But i wanted to insert a new line... so the text i'm appending must be a new line...
I tried entering "\n" + my appended string but the file recognizes \n as a square like ([]) character....
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MAYBE YOU COULD TRY SOMETHING LIKE THIS:

AND WRITE OUT THE NEWLINE STRING INSTEAD OF "\n". ON MANY PLATFORMS "\n" IS INSUFFICIENT. FOR EXAMPLE, WINDOWS USERS GENERALLY NEED "\r\n".
 
Anthony Yulo
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tnx...
 
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!