How to import mixed .txt - file in a table, with text as comment on first 3 rows and then numeric data with headers?

I look for a method how to impor data from txt file, which contains at first position important comment information and then a regular nummeric table.
I would also like to set a fixed width for cells containing a comment so that it is fully visible.
I will be very grateful for any information on solving the problem!

 Respuesta aceptada

Make it a two-step process!
First, read the first comment lines using FOPEN and FGETL. See the help of FGETL for an example. Do not forget to close the file with FCLOSE.
Two, read the rest of the file with READTABLE and use the HeaderLines option to skip the first comment lines.

Más respuestas (0)

Categorías

Más información sobre Data Import and Analysis en Centro de ayuda y File Exchange.

Productos

Versión

R2018b

Etiquetas

Preguntada:

el 20 de Feb. de 2019

Comentada:

el 20 de Feb. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by