Created
April 26, 2018 17:50
-
-
Save mikehenrty/5ffa89ea2c3261fd1bee23c2fa27ee6d to your computer and use it in GitHub Desktop.
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
const readline = require('readline'); | |
const fs = require('fs'); | |
// CHANGE THESE TO INPUT AND OUTPUT FILES | |
const FILE_PATH = './11k-german-sentences.txt'; | |
const OUTPUT_PATH = './output.csv'; | |
const rl = readline.createInterface({ | |
input: fs.createReadStream(FILE_PATH), | |
}); | |
const output = fs.createWriteStream(OUTPUT_PATH); | |
let count = 0; | |
rl.on('line', (line) => { | |
output.write(`${++count},${line}\n`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment