title: CSV file console logging is undefined - JS
body: <p>I am trying to <code>console.log</code> a column from a <code>.csv</code> file and it is undefined:</p>
  <pre class="lang-js prettyprint-override"><code>const fs = require(&quot;fs&quot;);
  
  fs.readFile(&quot;./data.csv&quot;, &quot;utf8&quot;, (err, data) =&gt; {
      if (err) {
          console.error(err);
          return;
      }
      const lines = data.split(&quot;\n&quot;);
      console.log(&quot;MID        Merchant&quot;);
      for (const line of lines) {
          const columns = line.split(&quot;,&quot;);
          console.log(columns[0] + &quot;        &quot; + columns[1]);
      }
  });
  </code></pre>
  <p>Screenshot of the code and data.csv:</p>
  <p><a href="https://i.stack.imgur.com/LSuy4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LSuy4.jpg" alt="enter image description here" /></a></p>