title: How to replace a text sequence that includes "\n" in a text file
body: <p>This may sound duplicated, but I can't make this works.</p>
  
  <p><strong>Consider:</strong><br/></p>
  
  <p>_ = space<br/>
  - = minus sign</p>
  
  <p><code>particle_little.csv</code> is a file of this form:</p>
  
  <pre><code>waste line to be deleted
  __data__data__data
  _-data__data_-data
  __data_-data__data
  </code></pre>
  
  <p><strong>I need to get</strong> a standard csv format in <code>particle_std.csv</code>, like this:</p>
  
  <pre><code>data,data,data
  -data,data,-data
  data,-data,data
  </code></pre>
  
  <p><strong>I am trying to</strong> use <code>tail</code> and <code>tr</code> to do that conversion, here I split the command:</p>
  
  <ol>
  <li><code>tail -n +2 particle_little.csv</code> to delete the first line<br/> </li>
  <li><code>| tr -s ' ' </code> to remove duplicated spaces<br/></li>
  <li><code>| tr '/\b\n \b/' '\n'</code> to delete the very beginning space<br/></li>
  <li><code>| tr ' ' ','</code> to change spaces for commas<br/></li>
  <li><code>> particle_std.csv</code> to put it in a output file</li>
  </ol>
  
  <p><strong>But I get this</strong> (without the 4th step):</p>
  
  <pre><code>data
  data
  data
  -data
  ...
  </code></pre>
  
  <p>Finally, the file is huge, so it is almost impossible to open in editors (I know there are super editors that maybe can)</p>