how to get string and numbers separately using csvread

9 次查看(过去 30 天)
How to get string and numbers separately from csv file using csvread. I have a csv file with "A-Z" numerical columns and 100 rows. Column "AA" is string
How to get the numerical and text field separately using csvread
M = csvread(excelFileName, 1, 1, [1 1 100 26]);
Error using dlmread (line 143)
Mismatch between file and format string.
Trouble reading 'Numeric' field from file (row number 1, field number 27) ==>
Genuine,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,...
Error in csvread (line 49)
m=dlmread(filename, ',', r, c, rng);

采纳的回答

Jan
Jan 2018-3-20
编辑:Jan 2018-3-20
When you get an error message, start with reading the documentation:
doc csvread
There you find:
The file must contain only numeric values.
This mean clearly, that you cannot import your file using csvread because: 'Column "AA" is string'. Use textread or readtable instead.
Note: You are a long term user of this forum. It does not look efficient, if it is still required to suggest reading the documentation.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import and Export 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by