formatstring error when using tabularTextDatastore
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello all,
I am trying to read a large CSV file (~500GB) using tabularTextDatastore.
my command line is just one:
ds = tabularTextDatastore('filename.csv')
the error I'm getting is:
Error using tabularTextDatastore (line 147)
Output argument "formatString" (and maybe others) not assigned duting call to "matlab.io.internal.text.determineFormatString>convertDatatypeToFormatString".
could't find any material on this error online, can someone please advise?
thanks!
답변 (1개)
Jeremy Hughes
2022년 12월 8일
편집: Jeremy Hughes
2022년 12월 8일
Turns out this was a bug in R2020a and is been fixed in R2020b. See: https://www.mathworks.com/support/bugreports/2263913
You can work around this with:
ds = tabularTextDatastore('sample file.csv','Delimiter',';','TextscanFormats',"%f%f%f%f%f%q")
or
ds = tabularTextDatastore('sample file.csv','Delimiter',';','TextscanFormats',"%f%f%f%f%f%x")
댓글 수: 5
Jeremy Hughes
2022년 12월 13일
This looks like a separate issue with the format of the file not matching the expected format. You'll need to check the contents match on each row. If the rows aren't consistent with each other, then you might need to clean up the file to work with tabularTextDatastore.
If you're reading one file, then try readtable.
Jeremy Hughes
2022년 12월 13일
The other alternative is to use all %q fields:
ds = tabularTextDatastore('sample file.csv','Delimiter',';','TextscanFormats',"%q%q%q%q%q%q")
참고 항목
카테고리
Help Center 및 File Exchange에서 Standard File Formats에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!