title: js import csv , use 2nd item as argument in external curl command
body: <p>stuck in between the code. Please help</p>
  <p>User story:</p>
  <p><strong>Command line user want to use js script to open a csv file (example attached), and for all the dev_no items (5000+) read from the file execute a shell curl command</strong></p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">serial_no</th>
  <th style="text-align: left;">type</th>
  <th style="text-align: left;">dev_no</th>
  <th style="text-align: left;">accu_pulses</th>
  <th style="text-align: left;">last_update</th>
  <th style="text-align: left;">warehouse</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">1833002293</td>
  <td style="text-align: left;">30</td>
  <td style="text-align: left;">4437e68af4e01038</td>
  <td style="text-align: left;">10</td>
  <td style="text-align: left;">2021-09-08 11:01:20</td>
  <td style="text-align: left;">false</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Code for executing curl command: Works!</p>
  <pre><code>const { stdout } = require('process');
  const util = require('util');
  const exec = util.promisify(require('child_process').exec);
  const header = 'curl -X GET -k \&quot;XXXX/api/v1/device?id='
  const end = '&amp;access_token=XXXX\&quot;'
  
  async function CurlExample(DeviceId) {
    const {
      stdout,
      stderr
    } = await exec(header+DeviceId+end);
    console.log('stdout:', stdout);
    console.error('stderr:', stderr);
  }
  
  const dev_no= [ &quot;4437e68af4e01027&quot; ,    ] 
  for (let i = 0; i &lt; eUID.length; i++) {
      CurlExample(eUID[i],stdout)
  }
  </code></pre>
  <p>Code for CSV import:
  used as guidance <a href="https://sebhastian.com/javascript-csv-to-array/" rel="nofollow noreferrer">https://sebhastian.com/javascript-csv-to-array/</a>
  works fine, but then I am stuck how to address the correct element of the data array and pass it as argument to the Curl shell command!</p>
  <p>Ask:
  help execute the user story by adding the missing command
  Extra bonus: propose a better code!</p>
  <p>thanks!</p>