how to load an ASCII file
147 ビュー (過去 30 日間)
古いコメントを表示
Nandakumar Unnikrishnan
2020 年 7 月 25 日
コメント済み: Nandakumar Unnikrishnan
2020 年 7 月 26 日
I am trying to load an ASCII file that I downloaded from CST. But the usual load tricks that I do don't seem to work and I cannot seem to find the correct method to load the file. The ASCII text file has multiple columns and a the headers are seperated from the rest of the column with one row of --------- signs. This makes it harder to put the columns into variables. Is there any advice to fix this issue?
Thank you,
Nandakumar
3 件のコメント
採用された回答
jonas
2020 年 7 月 25 日
編集済み: jonas
2020 年 7 月 26 日
Based on the sample given in the comments
A = readmatrix('Trial 1.txt')
or better yet,
opts = detectImportOptions('Trial 1.txt','VariableNamesLine',1);
T = readtable('Trial 1.txt',opts);
for older versions you can use textscan
fid = fopen('Trial 1.txt')
out = textscan(fid,repmat('%f',1,10),'headerlines',2,'collectoutput',1)
fclose(fid)
5 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!