Merge multiple txt files in matlab
20 次查看(过去 30 天)
显示 更早的评论
Hello,
I have multiple txt files and I want to merge them into a single matrix in matlab. Each file has 3 rows of headers. A summary of what I am looking for is below:
- Read and combine/merge 3 txt files into a single data matrix in matlab. Each txt file has 13 rows (3 hearders, 10 numeric data. Please see image below). The first column (numeric data) is the same for all the files. I want to merge only the 2nd columns of ALL 3 txt files.
- Each txt file has 3 row headers. I want to extract and merge the 2nd row header of each txt file into a matrix called header. The 2nd row header of each file should be in its own row in header.
Please image is shown below:
Thank you
2 个评论
Anirudh Singh
2020-7-14
Some answer on the same issue are given below, you can use these as a starting point:
- https://www.mathworks.com/matlabcentral/answers/83872-how-can-i-combine-multiple-text-files-with-the-same-prefix-but-in-different-folders
- https://www.mathworks.com/matlabcentral/answers/463166-merging-multiple-text-files
- https://www.mathworks.com/matlabcentral/answers/478717-combine-multiple-text-files-into-one-matrix
if the above link did not resolve the issue, post the issue you are facing while merging the multiple .txt files.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!