Error when reading the text file
Mostrar comentarios más antiguos
I have the following text file and I want to read it, when I read it I got the following error :
I know that the source of error comes from the lines that are like this:
1.00 0.9
9 1.00 0.99
it should be one line like this
1.00 0.99 1.00 0.99
is there a method to organize these lines, if not how can I exclude it automatically?
data = dlmread("output3.txt");
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 10 de Abr. de 2023
Editada: Image Analyst
el 10 de Abr. de 2023
0 votos
It's a highly corrupted file - it's a dumpster fire.


Numbers are missing on some lines, and many lines are blank with no numbers at all. Some lines have text and numbers both in the line.
I suggest you investigate why your file is being written out so messed up in the first place rather than try to read and repair a badly damaged file.
3 comentarios
Image Analyst
el 11 de Abr. de 2023
Editada: Image Analyst
el 11 de Abr. de 2023
Then perhaps you should post the original file before you manually altered it.
To process a sequence of files, see the FAQ:
[EDIT] Wait a minute. Are you saying the corrupted file you attached was the original file, or the one you manually edited?
M
el 12 de Abr. de 2023
Categorías
Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!