Created
November 19, 2021 10:27
-
-
Save viraj124/c9ad6a045aa2e040eb0773457d60649a to your computer and use it in GitHub Desktop.
array_generation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'fs' | |
import csv from 'csv-parser' | |
const json: any = [] | |
fs.createReadStream('scripts/input.csv') | |
.pipe(csv()) | |
.on('data', (row: any) => { | |
const val: any = Object.values(row)[0] | |
json.push(val) | |
}) | |
.on('end', () => { | |
console.log(json) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment