フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Editing large number of dat files

1 回表示 (過去 30 日間)
012786534
012786534 2017 年 6 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello all,
I want to add the same comment to the second line of a large number of dat files and then place them in a new folder.
I was thinking of doing something like this:
NewFiles = fullfile(pwd, 'NewFiles')
if exist([pwd '\NewFiles'])~=7
mkdir(NewFiles);
end
files = dir(fullfile('*.dat'));
filenames = {files.name};
for i = 1 : length(filenames)
fid(i) = fopen(files(i),'w');
fprintf(fid,'try \n');
fclose(fid);
dlmwrite(fname,'-append') ;
end
This code does not work, obviously.
Any suggestions ?
Thank you

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by