How to open several txt files?

2 views (last 30 days)
Lilya
Lilya on 13 Aug 2017
Commented: KSSV on 13 Aug 2017
Hello everyone,
thank you in advance for the help. I would like to open several text files (loop) named by the following: RDLm_RABG_2017_07_01_0000.ruv
RDLm_RABG_2017_07_01_0100.ruv
RDLm_RABG_2017_07_01_0300.ruv . . . etc
then how to read them and extract the information all have the same header and the parameters to extract ( let's say the first 3 column)
thank you once again.

Accepted Answer

KSSV
KSSV on 13 Aug 2017
files = dir('*.txt');
nfiles = length(files);
data = cell(nfiles,1);
for i = 1 : nfiles
fid = fopen(files(i).name);
% read data
fclose(fid);
end
  6 Comments
Lilya
Lilya on 13 Aug 2017
Ok. Thank you so much
KSSV
KSSV on 13 Aug 2017
Thanking is accepting the answer...

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB 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!