79168583

Date: 2024-11-08 02:22:55
Score: 1
Natty:
Report link

Or, maybe you could use some CSV reader library to looping through the CSV contents like this?

const fs = require('fs');
const csv = require('csv-parser');

fs.createReadStream('test.csv')
  .pipe(csv())
  .on('data', (row) => {
      console.log(row['Modem ID'], row['Total Chargeable'].replace(',', '.'));
  })
  .on('end', () => {
      console.log('CSV file successfully processed');
  });

I think this approach would be better, rather that you read the CSV as a string

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Richard William