title: Add Headers to CSV and Return Row with Matching String in Node.js
body: <p>I am trying to return a row value on a matching string. </p>
  
  <p>I begin with a csv that doesn't have header details.  After loading the csv into memory, I think I need to first add headers and then convert the data to json, then loop through the data to find the correct object in the array.</p>
  
  <p>I have used highland to create a read stream and output to objects.  However, the line break characters <code>\r</code> and <code>\r\n</code> are not getting parsed out and are injected into the value strings.</p>
  
  <p>This approach also doesn't seem to parse the entire file, it is outputting 3 lines.</p>
  
  <pre><code>highland(fs.createReadStream('example.csv', 'utf8'))
    .map(line =&gt; line.split(','))
    .map(parts =&gt; ({
      a: parts[0],
      b: parts[1],
      c: parts[2]
  }))
  .each(x =&gt; console.log(x))
  </code></pre>
  
  <p>It would be nice to structure the CSV as JSON and then use the <code>.filter()</code> method to match the record.</p>
  
  <p>Actual output of 1000+ line file</p>
  
  <pre><code>{ a: '', b: 'CD53110' }
  { a: '\nRD40115', b: 'CD40315' }
  { a: '', b: '63\r\nRE15468' }
  { a: '96798', b: '5\r\nRR60899' }
  </code></pre>
  
  <p>Example input snippet</p>
  
  <pre><code>,CD510,13
  ,T9069,65
  RCM22,TC633,101
  RC023,87693,16
  M2024,T7636,109
  </code></pre>
  
  <p>Note: first few rows only contain 'b' and 'c' columns.</p>