textscan not working with double quotation marks
古いコメントを表示
I am using textscan to read a .txt file into matlab but i am having some troubles. The data looks like (first two lines)
1950 "Afghanistan" 8150.368 n/a n/a n/a n/a n/a
1951 "Afghanistan" 8284.473 n/a n/a n/a n/a n/a
and i am using textscan as
PWT = 'Data ind\PWT6.txt';
fid =fopen(PWT);
tmp = textscan(fid,'%f %q %f %f %f %f %f %f','delimiter','\r');
The first column is read ok, the countries are all stored on tmp{1}, but it seems like all the rest is stored in tmp{2} when i actually only want the countries there. Am i using %q wrong or what is going on ?
Thanks :)
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Variables についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!