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