필터 지우기
필터 지우기

Read .CSV file and remove lines

조회 수: 2 (최근 30일)
Jake Marvin
Jake Marvin 2018년 10월 6일
답변: Star Strider 2018년 10월 6일
I need to read in a .csv file that has 3 header lines and each line of data also ends in 'Speed 1' which is unwanted. I would like the data in just a double array with 4 columns.
  댓글 수: 1
madhan ravi
madhan ravi 2018년 10월 6일
In the csv file which you uploaded I see 5 different types of datas with different headers?

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

채택된 답변

Star Strider
Star Strider 2018년 10월 6일
This may be the least aesthetically appealing code I ever wrote. Its only redeeming factor is that ‘Result’ is the matrix you want:
[D,S,R] = xlsread('20lbin.csv');
S2 = S(4:end,:);
S3 = strsplit([S2{:}],'Speed 1')';
S4 = sscanf([S3{:}],'%f,');
Result = reshape(S4, 4, [])';

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by