Does not properly read csv file

조회 수: 22 (최근 30일)
alpedhuez
alpedhuez 2021년 4월 14일
답변: Walter Roberson 2021년 4월 14일
I try to read the attached csv file using readtable. But the data does not seem to be read. What can be done?

채택된 답변

Walter Roberson
Walter Roberson 2021년 4월 14일
readcell() instead of readtable(). Your file mixes data types.

추가 답변 (1개)

Thomas Jensen
Thomas Jensen 2021년 4월 14일
Hi,
Try to use readtable('test.csv','Format','%s,%s'). It will force the data to be treated as text.
Since you columns are mixing number and date values, it is better to keep it as char and post-process it later.
  댓글 수: 1
alpedhuez
alpedhuez 2021년 4월 14일
Error using readtable (line 245)
Unable to read the entire file. You may need to specify a different format, delimiter, or number of header lines.
Note: readtable detected the following parameters:
'Delimiter', ',', 'HeaderLines', 0, 'ReadVariableNames', true

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by