How to open several txt files?

1 次查看(过去 30 天)
Lilya
Lilya 2017-8-13
评论: KSSV 2017-8-13
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.

采纳的回答

KSSV
KSSV 2017-8-13
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 个评论
Lilya
Lilya 2017-8-13
Ok. Thank you so much
KSSV
KSSV 2017-8-13
Thanking is accepting the answer...

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by