title: Alternative to File.AppendAllText for newline
body: <p>I am trying to read characters from a file and then append them in another file after removing the comments (which are followed by semicolon). </p>
  
  <p>sample data from parent file:</p>
  
  <pre><code>           Name- Harly Brown             ;Name is Harley Brown
  
             Age- 20                  ;Age is 20 years
  </code></pre>
  
  <p>Desired result:</p>
  
  <pre><code>           Name- Harley Brown
  
             Age- 20
  </code></pre>
  
  <p>I am trying the following code-</p>
  
  <pre><code>        StreamReader infile = new StreamReader(floc + "G" + line + ".NC0");
          while (infile.Peek() != -1)
          {
              letter = Convert.ToChar(infile.Read());
              if (letter == ';')
              {
                  infile.ReadLine();
              }
  
              else
              {
  
                  System.IO.File.AppendAllText(path, Convert.ToString(letter));
  
              }
           }
  </code></pre>
  
  <p>But the output i am getting is-</p>
  
  <pre><code>            Name- Harley Brown  Age-20
  </code></pre>
  
  <p>Its because AppendAllText is not working for the newline. Is there any alternative?</p>