0
i want to pass the strings of a txt file to an array and as soon as each line was passed to the array the program would run it normally, then he would repeat and pick up the second string of the txt file. Everything is being done in javascript/nodejs only it’s been 2 days since I stopped at it and can’t get out of the corner.
loop code with the file and array:
function email_parser(){
var fs = require('fs');
var email_count = "";
var array = [];
var array = fs.readFileSync('email.txt').toString().split("rn");
for(var i = 0; i < array.length; i++) {
email_count = array[i];
}}
and I’m calling it the variable this way
email = email_parser();
Thank you!.
Didn’t work :/
– jorleide da silva
@jorleidedasilva strip the
.toString()
, the. readFileSync
already gives you a string.– Sergio
@jorleidedasilva if you still can’t give me an example of the text, or put the file online to create an example for you to see.
– Sergio