Borrar filtros
Borrar filtros

How to read .txt and convert to .xlsx?

1 visualización (últimos 30 días)
Shoumy
Shoumy el 20 de Ag. de 2018
Comentada: Walter Roberson el 20 de Ag. de 2018
I have a .txt file with 135 columns and around 1000 rows. I want to convert it into an excel file. However when I use importdata, some of the rows are read as string and stuffed into one cell. I have also tried textscan but I get the error 'Index exceeds matrix dimensions.'. How do I write a code where each row in .txt will be written in its separate cell in .xlsx for all 1000 rows?
  1 comentario
Walter Roberson
Walter Roberson el 20 de Ag. de 2018
readtable() and then writetable() .
Depending how the .txt file is divided internally, it might be easier to use detectImportOptions() before the readtable() .

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by