필터 지우기
필터 지우기

Does textscan not work properly/needs some other inputs in R2013b?

조회 수: 1 (최근 30일)
Aniket Vagha
Aniket Vagha 2014년 10월 10일
편집: Aniket Vagha 2014년 12월 4일
I use textscan to read data from a large number of .csv files. The script works perfectly well on my work laptop (64-bit, R2010a), but fails to read any data when I use the same script on my workstation (64-bit, R2013b).
The red text I see on R2013b: Error using textscan Mismatch between file and format string. Trouble reading number from file (row 1u, field 9u).
Command I am using:
Data = textscan( fid, DataFormat, NumberOfRows, 'delimiter', ',' ...
, 'treatAsEmpty', {'NA', 'Unknown'}, 'headerlines', NumOfHeaderlines ...
, 'ReturnOnError', false)
Please advise.
  댓글 수: 3
per isakson
per isakson 2014년 10월 10일
"(row 1u, field 9u)" &nbsp Is that really a "u"? Encoding problem?
"Mismatch between file and format string" &nbsp What is the value of fid?
I'll test with R2013b if you attach a data-file
Aniket Vagha
Aniket Vagha 2014년 12월 4일
편집: Aniket Vagha 2014년 12월 4일
Apologies! I had forgotten to attach the file.
I used this: fid = fopen('textscan_temp.xlsx'); data = textscan(fid, '%d %d %d %s').
I got empty cell array.

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

답변 (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