Loading CSV file (date column A, identifier row, rest data)

조회 수: 1 (최근 30일)
Oli
Oli 2016년 3월 15일
댓글: Oli 2016년 3월 24일
I want to Import the attached csv with following Code: >> d = dbload('data_US.csv');
If I then check for the variable d, it shows correctly 13 fields, but each of the fields contains only NaN's
Thank you very much
  댓글 수: 4
Star Strider
Star Strider 2016년 3월 16일
There are several options: xlsread, textscan, readtable and others.
Oli
Oli 2016년 3월 24일
Thank you very much!

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

채택된 답변

Daniel LaCroix
Daniel LaCroix 2016년 3월 16일
There is a function called csvread that should load the file.
If your file has headers (or anything other than numbers), the command won't work. To get around this, set it to have an offset of one row (and no column offset).
data=csvread('data_US.csv') or data=csvread('data_US.csv',1,0)
You can also select a more specific range of data if you need to, so check out the documentation if that's something you want to do.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by