reading data from a file which include symbols.
2 ビュー (過去 30 日間)
古いコメントを表示
I need to read the first column of the file attached and the last 3 digits of each line as a column. Appreciate any help.
0 件のコメント
採用された回答
Walter Roberson
2015 年 5 月 27 日
t = regexp(fileread('Dst.txt'), '(\r)?\n', 'split');
firstcol = regexp(t, '^\S+', 'match');
last3 = regexp(t, '...$', 'match');
first_last = [firstcol(:), last3(:)];
first_last{1,1}, first_last{1,2} is the pair for the first line
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Import and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!