DEV Community

Discussion on: Read CSV File using Node JS

Collapse
 
tahorsuijuris profile image
TahorSuiJuris

Question, please:

Why does this only return the first character of the string?

    const searchkeywords = fs.readFileSync('kwords.csv','utf-8');
        for (let kword of searchkeywords) {
    console.log(`Search Keyword: ${kword}`);

Text for the first 10 rows is:

"1-800-FLOWERS.COM, INC.",
"1ST SOURCE",
"1ST SOURCE CORP",
"3D SYSTEMS",
"8X8, INC.",
"A.H. BELO",
"AAON",
"AARON RENTS",
"ABERCROMBIE & FITCH",
"ABIOMED",