Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: Processing many sequential files

$
0
0
dpb <none@non.net> wrote in message <ktmf7b$1hh$1@speranza.aioe.org>...

> You can't guarantee any order of files returned by dir...to ensure
> processing in sequence you'll need to sort the directory by name. That
> minor ( :) ) point aside, do a dir() on each subdirectory you need and
> work on those in sequence -- sotoo of
>
> for i=1:numDirsToProcess
> d{i}=dir(fullfile(dirname(i),'*.txt'));
> end
>
> Above is cell array of directory structures, one for each subdir
> Now go thru them...
>
> for i=1:length(d)
> for j=i:length(d{i})
> ...
> end
> end
>
> Arrange the logic within the loops to get the ones you want from which
> directory; maybe it's better to loop over the files first; depends on
> just what you want to do...
>
> --
>
Ok I think I understand what you are trying to explain, are you saying make a directory of each batch and then process each directory within one loop? I'm having trouble following your code though and can't make sense of the first bit.

Viewing all articles
Browse latest Browse all 19628

Trending Articles