batch processing unknown number of txt files

my data are in txt format. I don't know how many txt files I will have every time before exporting them. And their names were already determined by the software when I exported them. Can I still use matlab for batch processing?

 采纳的回答

Of course you can batch-process using MATLAB:
S = dir(fullfile(pathname,'*.txt'));
out = cell(size(S));
for k = 1:numel(S)
filename = S(k).name;
filepath = fullfile(pathname,filename);
... do whatever with each file
out{k} = ... save any data
end
And read this for a more detailed explanation:

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Filename Construction 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by