Skip to content

Instantly share code, notes, and snippets.



Created Jan 31, 2020
What would you like to do?
Ler arquivo texto linha a linha com node.js
const fs = require('fs');
const readline = require('readline');
const rl = readline.createInterface({
input: fs.createReadStream('arquivo.tsv'),
crlfDelay: Infinity
rl.on('line', linha => {
let campos = linha.split('\t'); // campos delimitados por tab
console.log( `Inscrição: ${campos[1]} - Evento: ${campos[2]} - Nome: ${campos[0]}` );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment