# Read error with TXT and CSV files. SyntaxError: expected expression, got keyword 'do' at undefined:965:8

**URL:** https://discourse.processing.org/t/read-error-with-txt-and-csv-files-syntaxerror-expected-expression-got-keyword-do-at-undefined8/49463
**Category:** p5.js
**Tags:** contributions
**Created:** [September 24, 2026, 10:08pm UTC](https://discourse.processing.org/t/read-error-with-txt-and-csv-files-syntaxerror-expected-expression-got-keyword-do-at-undefined8/49463 "2026-09-24T22:08:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mgdunefa2](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@mgdunefa2](https://discourse.processing.org/u/mgdunefa2)
#### Post date: [September 24, 2026, 10:08pm UTC](https://discourse.processing.org/t/read-error-with-txt-and-csv-files-syntaxerror-expected-expression-got-keyword-do-at-undefined8/49463/1 "2026-09-24T22:08:28Z")

</div>

‘’’ javascript  
let palabras = ;  
let palabraActual = “”;  
async function setup() {  
createCanvas(800, 500);  
try {  
const respuesta = await fetch(“palabras.txt”);  
const texto = await respuesta.text();  
palabras = texto  
.split(/\r?\n/)  
.map(p =\> p.trim())  
.filter(p =\> p.length \> 0);  
console.log(“Palabras cargadas:”, palabras.length);  
} catch (error) {  
console.error(“Error leyendo palabras.txt:”, error);  
}  
}  
function draw() {  
background(240);  
fill(0);  
textAlign(CENTER, CENTER);  
textSize(60);  
text(palabraActual, width / 2, height / 2);  
}  
function mousePressed() {  
if (palabras.length \> 0) {  
const indice = floor(random(palabras.length));  
palabraActual = palabras[indice];  
console.log(  
“Índice:”, indice,  
“Palabra:”, palabraActual  
);  
}  
}  
‘’’  
Read error with TXT and CSV files  
When loading a “palabras.txt” or “palabras.CSV” file containing 69,327 words using the `loadStrings` or loadTable function, it indicates that the file has no records and displays the error: “SyntaxError: expected expression, got keyword ‘do’ at undefined:965:8”.  
If I use the command `await fetch("palabras.txt");`, it reads all the data from the file, although it still displays the error: SyntaxError: expected expression, got keyword ‘do’ at undefined:965:8.
