Tengo esas líneas de datos:
1234;06/07/22;06/07/22;VRT; ;31070;some String content;some String content; ;147.10;A;1234 1234;06/07/22;06/07/22;VRT; ;31070;some String content;some String content; ;147.10;A;1234 1234;06/07/22;06/07/22;VRT; ;31070;some String content;some String content; ;147.10;A;1234 1234;06/07/22;06/07/22;VRT; ;31070;some String content;some String content; ;147.10;A;1234 1234;06/07/22;06/07/22;VRT; ;31070;some String content;some String content; ;147.10;A;1234 Quiero contar cuánto tiempo apareció la letra A en esas líneas que debe imprimir 5 .
Entonces, lo que tengo es un archivo con 19 líneas y todas esas líneas tienen la letra A cuando probé este código recortado, me devuelve solo 12. Aquí está la imagen para demostración: 
Probé este código:
let nLines = 0; let counter = 0; for (let i = 0, n = this.csvRecords.length; i < n; ++i) { if (this.csvRecords[i] === '\n' && this.csvRecords.length[i][10] === 'A') { ++nLines; counter++; } console.log("number of lines in the file is: ", this.csvRecords.length) // this is giving me 19 which is right } console.log(counter) // this is giving me 0 which is wrong Así que console.log( "showing u[10] is: " , this.csvRecords[10].length); me está imprimiendo la décima línea y cuenta datos con delimitador y eso no es lo que quiero, quiero cuánto apareció en todas las líneas.