Import data from CSV file by Import Tool or textscan

2 visualizaciones (últimos 30 días)
kei hin
kei hin el 5 de Nov. de 2021
Respondida: kei hin el 5 de Nov. de 2021
I can import data from csv file by Import Tool(out type:string), and the tool could creat a script(textscan in it) to instead Import Tool. But, when I use Import Tool or script to import csv file, it lost blank line which in csv file. How to solve it? Thanks.
  4 comentarios
KSSV
KSSV el 5 de Nov. de 2021
Read about readtable to load csv file.
kei hin
kei hin el 5 de Nov. de 2021
Editada: kei hin el 5 de Nov. de 2021
readtable lost blank line too,and variable name in csv file will be changed. It is boring.

Iniciar sesión para comentar.

Respuesta aceptada

kei hin
kei hin el 5 de Nov. de 2021
In the script which Import Tool created, change
delimiter = ',';
to
delimiter = {',','\r'};
It seems to have been solved.

Más respuestas (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 5 de Nov. de 2021
Use readmatrix() that would import all numerical data in a matrix form.

Categorías

Más información sobre Data Import and Export en Help Center 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