Remove equal sign and quotation marks in readtable
Mostrar comentarios más antiguos
I am trying to read a csv file that includes both text and numbers. Here is a screenshot of the file.

I am using the following command:
tmp = readtable('file.csv','Format','auto','ReadVariableNames',0);

The tmp file is full of equal signs and quotation marks, which are indeed in the csv file, but are not displayed in excel. For some reason, when I run the same code on a different machine, the tmp file looks much nicer because it does not have the quotation marks and equal signs. I don't know if that is due to the way matlab or excel are setup. In both cases, it's Matlab 2020b.
Is there a possibility to always remove the equal signs and quotation marks when reading the table? I am looking for a robust solution that ensures that the code can be run on different machines.
Thanks!
4 comentarios
Stephen23
el 7 de Abr. de 2022
Tintin Milou
el 7 de Abr. de 2022
"Here is a screenshot of the file. "
No, that is just how some random Application displays it. Excel is an unreliable tool for viewing file content, it can even change data without warning:
The actual text file looks like this:

It appears that every single field has been defined as an Excel formula, rather than as the actual text or numeric data. The application that created that file is trying to make everyone's lives as difficult as possible.
Tintin Milou
el 7 de Abr. de 2022
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Text Files 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!