Why does %c not read whitespaces with the TEXTREAD function?
Mostra commenti meno recenti
Why does %c not read whitespaces with the TEXTREAD function?
I am trying to read a file using TEXTREAD. Here is an example input file:
one two three four
one two three four
I should be able to read this file using
[a, b] = textread('file', '%3c%3c%*[^\n]');
and expect the output to be:
a=[ 'one'; 'one' ] and
b=[ ' tw'; ' tw'; ]
But I get
a=[ 'one'; 'one' ] and
b=[ 'two'; 'two' ]
It appears that the whitespace between the 'one' and 'two' is skipped.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Startup and Shutdown in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!