help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: General algorithm to find systematically named files in sub-director


From: Markus Appel
Subject: Re: General algorithm to find systematically named files in sub-directories
Date: Sun, 09 Jun 2013 00:47:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

On 06/08/2013 04:53 AM, bondmatt wrote:

The LATEX portion is holding me up at the moment but only because I need to
bring myself up to speed on the language. If anyone knows how to put a
header on the table of contents page...

I am not exactly sure what you mean, but have a look at the \addcontentsline command:

\addcontentsline{toc}{section}{This text will appear in the toc and look like a section}

Depending on what is being tested the number of samples will vary. One
thought is a sort of brute force search through all 999 possible folders but
I am hoping there is a smarter way to do this?

If I understood correctly, you want to iterate over all files named e.g. sample1.wav in all project_XXX subdirectories? IMHO the best way for doing this would be something like:

files = glob("project_*/sample1.wav");
for f = files{:}'
  disp(f{1});
endfor

glob gives you a cell array of all matching filenames and can also be used to look in different subdirectories.

Cheers,
Markus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]