Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

start a new line in a TXT file


Best Answer hanzibal, 20 June 2013 - 12:17 PM

I usually use newline 'n' only and not vertical tab 'r' and as far as I remember, it should work.

 

Of course, when all else fails, you can always issue multiple calls to WriteLine().

Go to the full post


  • Please log in to reply
1 reply to this topic

#1 michel capua

michel capua

    Member

  • Members
  • PipPip
  • 26 posts

Posted 20 June 2013 - 11:13 AM

I have a file.txt and I need to write the content of cont on three differents rows.

in this example below i have used rn as carriage return but ti is no good.

 

FileStream filestream = new FileStream(rootDir + sFilename, FileMode.Open);
StreamWriter myFile = new StreamWriter(filestream);
 
String cont = "Variabile 1 = 9 rnVariabile 2 = 19 rnVariabile 3 = 39"

 

myFile.WriteLine(cont);
myFile.Close();

 

 

What have to use in the cont variable to start a new line?

 



#2 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 20 June 2013 - 12:17 PM   Best Answer

I usually use newline 'n' only and not vertical tab 'r' and as far as I remember, it should work.

 

Of course, when all else fails, you can always issue multiple calls to WriteLine().






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.