Merge multiple .txt files

조회 수: 2 (최근 30일)
Ivan Mich
Ivan Mich 2020년 5월 19일
편집: Stephen23 2020년 5월 22일
I would like to merge multiple .txt files, and create ONE .txt file with the conte of all .txt files.
How could I do that?
  댓글 수: 3
Ivan Mich
Ivan Mich 2020년 5월 22일
for example for .csv files I use these commands in order to merge them together after each iterartion.
clc
clear
files = dir('*.csv') ;
N = length(files) ;
iwant = cell(N,1) ;
for i = 1:N
num = xlsread(files(i).name) ;
iwant{i} = num ;
end
iwant = cell2mat(iwant) ;
csvwrite('ALL.csv',iwant)
For .txt files what to do?
Stephen23
Stephen23 2020년 5월 22일
편집: Stephen23 2020년 5월 22일
"For .txt files what to do?"
CSV files are text files.
What functions to use depends on the formatting of those text files, which you have not told us. You can select the functinos yourself here:

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Standard File Formats에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by