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

1 vue (au cours des 30 derniers jours)
Aniket Vagha
Aniket Vagha le 10 Oct 2014
Modifié(e) : Aniket Vagha le 4 Déc 2014
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 commentaires
per isakson
per isakson le 10 Oct 2014
"(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 le 4 Déc 2014
Modifié(e) : Aniket Vagha le 4 Déc 2014
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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Large Files and Big Data dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by