csvファイルから指定した行(8行目、8+20行目、8+20+20行目・・・)のデータを取り出し、その取り出したデータを新しいcsvファイルに保存したいです。行を指定した後、その行のデータを取り出すにはどのようにしたらよいですか?
Show older comments
filename='data.csv';
B=readmatrix(filename);
S=size(B);%ファイルの行数取得
delimiterIn=',';%カンマで区切る
i=0;
while 1
i=i+1;
A=8+20*i%読み込む行
if A>S %ファイルの最終行を超えたらループ終了
break
end
writematrix(A,'data_2.csv');
end
Accepted Answer
More Answers (0)
Categories
Find more on スプレッドシート 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!