Filter löschen
Filter löschen

how to get string and numbers separately using csvread

9 Ansichten (letzte 30 Tage)
Elysi Cochin
Elysi Cochin am 20 Mär. 2018
Bearbeitet: Jan am 20 Mär. 2018
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);

Akzeptierte Antwort

Jan
Jan am 20 Mär. 2018
Bearbeitet: Jan am 20 Mär. 2018
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.

Weitere Antworten (0)

Kategorien

Mehr zu Data Import and Export finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by