CSVread does not read file with offset
조회 수: 3 (최근 30일)
이전 댓글 표시
I'm attempting to read a csv file with offset but for some reason I get the following error:
Error using dlmread (line 147)
Mismatch between file and format character vector.
Trouble reading 'Numeric' field from file (row number 1, field number 7) ==> Y\n
My file looks like the following:
I'm attempting to use
M = csvread('filename.csv',1,2,[1,5,5,4])
If you can point out where I'm going wrong (and why the error points to Y\n) please let me know. Thanks.
댓글 수: 0
채택된 답변
Walter Roberson
2020년 7월 13일
csvread() can only skip complete leading text lines, and leading text columns. It is not able to skip trailing text columns even if you give a range parameter.
You should switch to readtable()
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!