Reading data from csv with non uniform formatting
이전 댓글 표시
Hi,
I am trying to read data from a cvs file (sample attached) with uneven formatting where there are a few sentences and lines with missing data points. I have been reading the file and then getting the row number for each time the column with is different to extract the data. I am trying to read ( and remove) the sentences and also remove the partially complete rows and creating one array from the remaining data. Is there any better way of doing this withouth having to check which row is incomplete? Any suggestions would be very helpful.
Thank you
댓글 수: 5
Cris LaPierre
2023년 4월 24일
It's a little unclear to me what the final result should be from the sample file you have shared. Is this the expectation?
A,1,2,3,4
B,1,2,3,4
C,1,2,3,4
D,1,2,3,4
A,1,2,3,4
B,1,2,3,4
C,1,2,3,4
A,1,2,3,4
D,1,2,3,4
C,1,2,3,4
E,1,2,3,4
AG15
2023년 4월 24일
Stephen23
2023년 4월 24일
"Would you recommend moving to readtable instead? "
Yes.
AG15
2023년 4월 24일
Cris LaPierre
2023년 4월 24일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!