delimit cells to columns with strings and numeric values

Below is the code I'm running. It pulls in a text file that is delimited with a semicolon.
clc; clear;
filename = 'U0400_ALL_LOCS.txt';
delimiterIn = ';';
headerlinesIn = 1;
A = importdata(filename,delimiterIn); %,headerlinesIn);
The file is read into Matlab, but only sepeates rows, not columns. The picture below is of the variable A.
MATLAB HELP.PNG
Any idea on how to get these to split into their respective columns?

 Respuesta aceptada

madhan ravi
madhan ravi el 30 de Nov. de 2018
Try using readtable() to read the text file

3 comentarios

Thanks for your help, that worked perfectly
filename = 'U0400_ALL_LOCS.txt';
A = readtable(filename)
Would you happen to know of good video that goes through the readtable documentation? I'm having trouble understanding the opts portion of using readtable.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Productos

Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by