title: Replacing a | delimiter with a \r\n but keeping the text in the same column and cell
body: <p>This was originally marked as a duplicate but the answer provided there was way off the mark.</p>
  <p>I have a c# app that reads a text file and looks for <code>^</code> characters and replaces them with <code>\t</code>. It also looks for <code>|</code> characters and attempts to replace them with <code>\r\n</code>.</p>
  <p>This .txt file should then be copied into a spreadsheet. The problem is that when the app replaces <code>|</code> it places the data into the first cell of a new row. I want it kept in the same cell/order it was originally with words separated by <code>|</code> forming sort of a vertical list within that single sell (a bit like a alt+Enter in Excel).</p>
  <p>For example the input is:</p>
  <pre><code>This^is^testing^to^see|if|it|works
  </code></pre>
  <p>The output I need is:</p>
  <pre><code>This    is    testing    to    see 
                                 if
                                 it
                                 works
  </code></pre>
  <p>Instead I get:</p>
  <pre><code>This    is    testing    to    see 
  if
  it
  works
  </code></pre>
  <p>I am currently using:</p>
  <pre><code> File.WriteAllText(textBox1.Text, File.ReadAllText(textBox1.Text).Replace(&quot;|&quot;, &quot;\r\n&quot;));
   File.WriteAllText(textBox1.Text, File.ReadAllText(textBox1.Text).Replace(&quot;^&quot;, &quot;\t&quot;));
  </code></pre>
  <p>Button Click Code: (note that textbox1.text contains the file path and file name gained via OpenFileDialog).</p>
  <pre><code>private void button2_Click(object sender, EventArgs e)
  {
      try
      {
          File.WriteAllText(textBox1.Text, File.ReadAllText(textBox1.Text).Replace(&quot;^&quot;, &quot;\t&quot;));
          File.WriteAllText(textBox1.Text, File.ReadAllText(textBox1.Text).Replace(&quot;|&quot;, &quot;\r\n&quot;));
          var input = File.ReadLines(textBox1.Text);
          var sb = new StringBuilder();
      }
      catch (Exception ex)
      {
          Console.WriteLine(ex.Message);
      }
      MessageBox.Show(&quot;File Editing Underway - Please give it a few seconds&quot;);
  }
  </code></pre>
  <p>Where am I slipping up?</p>
  <p>The closure of this question was of no help. <code>\r\n</code> does the same thing.<br />
  I need the replacement of the <code>|</code> delimiter to keep the information in the same cell. As you can see it the above example it is moving it a row down into the A (first) column thanks to the <code>\n</code> I assume.</p>