2つのテキスト出力ファイルを1つのテキストファイルにマージしようとしています。
ファイル1:
fin=fopen('d://box1.txt','wt');
fprintf(fin,' Hello \n');
ファイル2:
fin=fopen('d://box2.txt','wt');
fprintf(fin,'welcome \n');
何かご意見は?
2つのテキスト出力ファイルを1つのテキストファイルにマージしようとしています。
ファイル1:
fin=fopen('d://box1.txt','wt');
fprintf(fin,' Hello \n');
ファイル2:
fin=fopen('d://box2.txt','wt');
fprintf(fin,'welcome \n');
何かご意見は?
それを簡単に行うMATLABの方法はないと思います。ただし、システムコマンドを使用できます。
ウィンドウズ:
system(type a.txt b.txt >ab.txt)
Linux:
system(cat a.txt b.txt >ab.txt)
ファイルが現在のディレクトリにない場合は、ファイルにパスを入れることを忘れないでください。これは機能します:
fin=fopen('D:\box1.txt','wt');
fprintf(fin,' Hello \n');
fclose(fin)
fin=fopen('D:\box2.txt','wt');
fprintf(fin,'welcome \n');
fclose(fin)
system('type D:\box1.txt D:\box2.txt >E:\box12.txt')