• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

APPENDING A NEW LINE INTO A STRING FILE  RSS feed

 
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....
 
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...
 
Always! Wait. Never. Shut up. Look at this tiny ad.
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!