Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

conversion .txt to .xls

1 visualización (últimos 30 días)
Ahmed BOULMANE
Ahmed BOULMANE el 22 de Abr. de 2016
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
hello, please, how can I convert a txt file to an Excel file
  3 comentarios
Stephen23
Stephen23 el 27 de Abr. de 2016
Editada: Stephen23 el 27 de Abr. de 2016
Please upload an example file so that we can actually test our code on something.
Ahmed BOULMANE
Ahmed BOULMANE el 28 de Abr. de 2016
here is the file,

Respuestas (1)

Walter Roberson
Walter Roberson el 25 de Abr. de 2016
Depending on the format of the text file, there are different ways of reading it. Sometimes it is enough to load() the file. Sometimes you need textscan(). Sometimes you need to do a log of work with parsing it. Try the import wizard; if it is able to handle the file then it can generate code for you.
If you end up with a numeric matrix, use num2cell() to convert it to cell array.
When you have a cell array, use xlswrite() to save it as xls file.
Note: if you are running on OS-X or Linux, or on MS Windows without Excel installed, then use the File Exchange contribution xlwrite() instead of xlswrite()
  7 comentarios
Ahmed BOULMANE
Ahmed BOULMANE el 28 de Abr. de 2016
I have always the same number of group, but the number of row and column change
Walter Roberson
Walter Roberson el 28 de Abr. de 2016
I looked at your sample file with an editor. The difficulty of reading it in is going to depend upon exactly what data you want to extract out and into what variables. The difficulty is greatly increased if the "TOTAL =" data has to be extracted into the same variable as what it is being totaled.
Please show a sample output, indicating which values need to end up in which variables.

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by