필터 지우기
필터 지우기

how to get string and numbers separately using csvread

조회 수: 9 (최근 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 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