Excel to Text Conversion
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Amanda
el 20 de Ag. de 2012
Respondida: Fabio Alonso Da Silva
el 11 de En. de 2018
I can convert the excel file to text manually inside of Excel.
However, to make my MATLAB scripts more autonomous and not relying on
another application, I am struggling with converting a .xlsx file to
text inside of MATLAB. Is there a function or routine to convert a
.xlsx file to .txt?
Thanks,
Amanda
1 comentario
Akki
el 23 de Sept. de 2014
Is it possible to convert all sheets of a single excel file using single xlsread command?
Respuesta aceptada
José-Luis
el 20 de Ag. de 2012
Editada: José-Luis
el 23 de Sept. de 2014
The easy way:
Import to matlab using
[numData textData rawData] = xlsread('myFile.xlsx'), %doc xlsread for more details
and then save to text
save('pqfile.txt', 'rawData', '-ASCII'); %replace rawData with the actual data you are actually interested in.
Cheers
2 comentarios
Más respuestas (1)
Fabio Alonso Da Silva
el 11 de En. de 2018
It depends ( people do not like this statement in general), but to do a 'xlsread' and a 'save' right after, have in mind that MATLAB will use memory to do so, possibly creating a cell array. Therefore depending on the size of your file, this can become a memory constraint. Another option is to manually save the MATLAB file as text and then read line by line inside MATLAB so you can direct (or control how) each piece of data goes where. It is a way to get rid of empty spaces creating an useless cell, for instance. Depending also on the size of the generated txt file, you might want to create a way to search and load just the pieces of data of interest into your application, this saves memory, but then increases disk access. There is no free lunch.
0 comentarios
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!