Does not properly read csv file

20 次查看(过去 30 天)
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