Convert data form .txt file into .mat file
Show older comments
Hey guys, hope you doing well.
I need help converting the data of hundreds of .txt files into one matlab file. Each text file has 3 columns. I was thinking about extracting the data of each column and then save it as a variable into one .mat file. In the end i would like to have one matlab file with 3 columns/variables.
This is the code that i have, but its not working for my needs. I'm having problems extracting the data of each column.
Files_September = dir('202109*.txt')
files = numel(Files_September);
for k = 1:files
files2 = Files_September(k).name;
fid = fopen(files2);
data = fscanf(fid, '%c')
fclose(fid);
save('September','data')
end
I'm attatching one text file so that you know what type of files im working with.
Thank you for your help.
Accepted Answer
More Answers (0)
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!