Merging the Data in the Text Files for the Number of "N" Text Files
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
tinkyminky93
am 6 Jan. 2023
Kommentiert: Vilém Frynta
am 7 Jan. 2023
Hello,
In my directory I have N numbers of text files and I want to read all of them with the datas that they contain. After that, I want to merge these N text files to just one text file. What I did was finding the text files in the directory and find their names, I could not read them and merge them. Thanks for your help.
clc
clear
close all
directory = 'C:\me\me\Desktop\directory';
fileList = dir(fullfile(directory, '*.txt'));
names_temp = struct2cell(fileList);
text_name = names_temp(1,:);
0 Kommentare
Akzeptierte Antwort
Vilém Frynta
am 6 Jan. 2023
4 Kommentare
Vilém Frynta
am 7 Jan. 2023
oh, yes. readmatrix was function that i used to load my data. you should use your method to load the text data. maybe fileread or fscanf as i mentioned above.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu String Parsing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!