Creating a file from different-sized files.
Show older comments
Hi to all
I have these files consisting of two variabilities, so I want to create one formatted text file
start from the Line_2.mat, it will be the four rows of a now_file, then from the second file TT.txt, I want to add the table to now_file.
1 Comment
Anton Kogios
on 22 Feb 2023
Which variable in Line_2.mat are you talking about? And have you made an attempt at solving this? If so, post your code.
Accepted Answer
More Answers (1)
Did you want something like this? Note, I attached an import function called importTTfile.
load('Line_2.mat')
TT = importTTfile('TT.txt')
writetable(TT,'now_file','FileType','text')
Line_2 = table2array(Line_2)
fid = fopen('now_file.txt', 'a+');
fprintf(fid, Line_2{1});
fprintf(fid, Line_2{2});
fclose(fid);
Categories
Find more on Text Data Preparation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!