node-readlines
node-readlines copied to clipboard
First character is undefined
Hi everybody, I read a log file with the following code:
const liner = new lineByLine(file_name); let valore ="<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<Table>\n<Row><Cell>Contenuto log</Cell></Row>\n"; let l; while (line = liner.next()) { console.log(""+line); l+=""+line+"<br\>"; } valore+="\t<Row><Cell>"+htencode.encode(l, {mode: 'extensive', level: 'xml'})+"</Cell></Row>\n"; valore+="</Table>"; callback(null, valore);
I get the first character undefined can you explain to me why?