how to get string and numbers separately using csvread

6 ビュー (過去 30 日間)
Elysi Cochin
Elysi Cochin 2018 年 3 月 20 日
編集済み: Jan 2018 年 3 月 20 日
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 Center および File ExchangeData Import and Export についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by