title: How to read csv file in node js
body: <p>I am trying to read a csv file using node js.
  Her is my code </p>
  
  <pre><code>fs.readFile(config.csvUploadPath, function read(err, data) {
      if (err) {
          throw err;
      }
      console.log(data + 'my data')
  });
  </code></pre>
  
  <p>CONSOLE:</p>
  
  <pre><code>ID
  D11
  D33
  D55
  </code></pre>
  
  <p>Here I want to get the elements in the column ID and store those in an array. How can I do that? Can anyone suggest me help. Thanks.
  My controller:</p>
  
  <pre><code>var partnersModel = new partners(params);
          fs.readFile(config.csvUploadPath, function read(err, data) {
              if (err) {
                  throw err;
              }
          dataArray = data.toString().split(/\r?\n/);
              dataArray.forEach(function(v,i){
                  if(v !== 'DUI'){
                    partnersModel.dui.push(v);
                  }
              });
          });
          partnersModel.save(function(error, response){
  </code></pre>