title: Merge Files in a directory c#
body: <p>I have many text files in a directory and I need to merge them into one </p>
  
  <p>I tried the following code </p>
  
  <pre><code>File.WriteAllLines(
      outputFileName,
      Directory.GetFiles(directory, "*.txt")
          .SelectMany(f =&gt;
              File.ReadLines(f).Concat(new[] { Environment.NewLine })));
  </code></pre>
  
  <p>It works fine but my problem is that I get empty blank lines between the content of each file . Is there a way to modify it in order to get a text file without those empty lines ?</p>