Badly formed format string error using textscan
Ältere Kommentare anzeigen
hello
This line is saved in a document called test.txt :
146.557,Yes,Yes,Yes,OE
I tried to import this line using textscan with this code:
fid=fopen('test.txt');
data=textscan(fid,'%f%s%s%s%s%','Delimiter',',');
flcose(fid);
But i only got this error message: "Error using textscan Badly formed format string"
Why does that error message appear? How can i make this code work?
Antworten (1)
per isakson
am 14 Feb. 2017
Remove the ending "%"
>> data=textscan('146.557,Yes,Yes,Yes,OE','%f%s%s%s%s','Delimiter',',');
>> data
data =
[146.5570] {1x1 cell} {1x1 cell} {1x1 cell} {1x1 cell}
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!