help-octave
[Top][All Lists]
Advanced

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

Re: Loading data from file and omitting some extensions


From: Michal Studniarek
Subject: Re: Loading data from file and omitting some extensions
Date: Wed, 22 Jan 2014 16:06:26 +0100

This solves the problem :). Thank you very much!


2014/1/22 Andy Buckle <address@hidden>



On 22 January 2014 11:07, st.michal88 <address@hidden> wrote:
Thanks Andy! This is really good but in fact I realised that it doesn't solve
my problem. My files are indeed classified as "plain text document" but it
doesn't have implicit .txt ending. Is there a way to do something similar
but not by filtering all the .txt but excluding e.g. .png?

Regards,
Michal



--
View this message in context: http://octave.1599824.n4.nabble.com/Loading-data-from-file-and-omitting-some-extensions-tp4661241p4661243.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave


This will exclude png and gif


nr = readdir (pwd)
i=rows(nr);

 for a=(1:i)
   if isdir(nr{a})
     continue
   end
   printf('checking: %s\n',nr{a})
   if length(regexpi(nr(a),'\.png$|\.gif$'){1})!=0
     continue
   end
  
   % do stuff here
   printf('processing: %s\n',nr{a})
  
 end


--
/* andy buckle */


reply via email to

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