title: In javascript, how can I ignore blank lines while uploading a csv file?
body: <p>In a csv file that has some blank lines in between and the last line is blank as well, how can I ignore them or let's say, jump to the next not empty line?</p>
  
  <p>column1; column2; column3</p>
  
  <p>value1; value2; value3</p>
  
  <p>__________________this line is empty</p>
  
  <p>value7; value8; value9</p>
  
  <p>__________________this line (the last one) is empty</p>
  
  <p>I obtain the file content: </p>
  
  <pre><code>var fileString = evt.target.result; 
  </code></pre>
  
  <p>Than I do this to analize every single line and then to display it on my website: </p>
  
  <pre><code>var lines = fileString.split("\r\n"); 
  </code></pre>
  
  <p>Is there any possibility to write a loop that checks the blank lines and replace them? Like this:</p>
  
  <pre><code>var pattern = /\r?\n\r?\n/g;
  
  for(var i = 0; i &lt; fileString.length; i++){
    if(lines === null){
       lines.replace(pattern, '\n');
    }
  }
  </code></pre>