Error when reading the text file
Ältere Kommentare anzeigen
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");
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 10 Apr. 2023
Bearbeitet: Image Analyst
am 10 Apr. 2023
0 Stimmen
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 Kommentare
Image Analyst
am 11 Apr. 2023
Bearbeitet: Image Analyst
am 11 Apr. 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
am 12 Apr. 2023
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!