read file txt with strings and numbers
9 views (last 30 days)
Show older comments
Khoder Makkawi
on 11 Sep 2023
Commented: Star Strider
on 11 Sep 2023
blablabla
aaa 10 test 20
bbb 11 test1 21
ccc 12 test2 22
I have this data in a file .txt and I want to read the file.
I tried the following code but it is not working as I want to:
fid = fopen('test','r');
testData = fscanf(fid, '%s %d %s %d',[2 inf]);
fclose(fid);
0 Comments
Accepted Answer
Star Strider
on 11 Sep 2023
2 Comments
Star Strider
on 11 Sep 2023
‘How I can skip it ?’
Consider using the 'HeaderLines' name-value pair with readtable.
.
More Answers (0)
See Also
Categories
Find more on Text Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!