Why does the FSCANF function in MATLAB not leave the file pointer at the correct position when the format specifier includes trailing "skip" items?
Afficher commentaires plus anciens
I have a text file that contains the following:
a;b;c;d;
I use the FSCANF function to read the "a" and "b", using a "skip" format to skip the semicolons:
out = fscanf(fid, '%c%*c', 2);
where "fid" is the file identifier of the file.
However, the file pointer, as returned by
ftell(fid)
is left at 3, just ahead of the second semicolon. I expected the file pointer to be left at 4, just after the second semicolon.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Text Files dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!