Matlab cannot read data from a file which is saved as a text-file from Excel
Mostrar comentarios más antiguos
I am not able to load data from a file which was saved as a text-file from MS Excel. textscan and load return an empty matrix. I tried to retype the data within the file using MS Notebook, to save the file with new name, however without success. If I open a new text-file with MS Notebook and copy-paste there the data from the file saved from Excel, then there is no problem with reading. Why?
Respuestas (1)
per isakson
el 2 de Jun. de 2012
0 votos
You need to set the input argument, encoding, of fopen. There are many alternatives including "Unicode".
4 comentarios
Walter Roberson
el 2 de Jun. de 2012
Note: normally textscan() detects UTF encoding. There are, however, a few older Microsoft products which write out UTF-16 files without the required Byte Order Marker (BOM). I have not heard that Excel is among those: it tends to be only very old software such as WordPad.
Walter Roberson
el 2 de Jun. de 2012
Though of course sufficiently old MATLAB would not recognize UTF encoding.
G A
el 3 de Jun. de 2012
G A
el 3 de Jun. de 2012
Categorías
Más información sobre Large Files and Big Data 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!