Error when reading the text file
Afficher commentaires plus anciens
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");
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 10 Avr 2023
Modifié(e) : Image Analyst
le 10 Avr 2023
0 votes
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 commentaires
Image Analyst
le 11 Avr 2023
Modifié(e) : Image Analyst
le 11 Avr 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
le 12 Avr 2023
Catégories
En savoir plus sur Data Type Conversion dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!