help-octave
[Top][All Lists]
Advanced

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

Directory Listing in Octave


From: Greg_G
Subject: Directory Listing in Octave
Date: Thu, 3 Dec 2009 11:09:51 -0800 (PST)

Hello,

This should be an easy question but the answer is eluding me.  I am running
Windows XP Octave-3.2.3-3_i686-pc-mingw32.

I am trying to create a cell array of file names of a specific extension
from a tree of directories.  Each of the files in the list will later be
opened and scanned for data.  
I would like to use one “glob” or “dir” or “ls” command to search all levels
of the tree for the file type.  

Currently, I am using "glob" but I have to specify a pattern for each
hierarchical level and I have to know how many levels there are.  Is there a
way to search all of the unkown number of levels of subdirectories?
    
The “dir /b /s” and “ls –R” commands look like they should work but I have
not been able to get what I want using the system("dir /b /s") command.  

This is my current code:

Data_dir= “X:\\Test_stand\\2009”      % Base directory 
Pat1= {[Data_dir,”/*/*.dat”]};          % pattern for 1st level
Pat2= {[Data_dir,”/*/*/*.dat”]};       % pattern for 2nd level
Pat3= {[Data_dir,”/*/*/*/*.dat”]};
ZZ= glob({pat1,pat2,pat3});


Regards,
Greg



-- 
View this message in context: 
http://old.nabble.com/Directory-Listing-in-Octave-tp26631421p26631421.html
Sent from the Octave - General mailing list archive at Nabble.com.




reply via email to

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