码迷,mamicode.com
首页 > 其他好文 > 详细

copy the content of a file muliptle times and save as ordered files:

时间:2019-02-19 01:09:49      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:***   printf   file   transient   tran   open   ...   import   ase   

input: transient.case

outputs: transient_1.case, transient_2.case,...transient_101.case

**********

n=101;
fileinfo=importdata(‘transient.case‘,‘;‘);
for i=1:n
filename=sprintf(‘transient_%d.case‘,i);
filePh = fopen(filename,‘w‘);
fprintf(filePh,‘%s\n‘,fileinfo{:});
fclose(filePh);
end
*********

copy the content of a file muliptle times and save as ordered files:

标签:***   printf   file   transient   tran   open   ...   import   ase   

原文地址:https://www.cnblogs.com/code-saturne/p/10398493.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!