Login  Register

Re: Chose only specific file on a folder

Posted by lechristophe on May 30, 2008; 7:07am
URL: http://imagej.273.s1.nabble.com/Chose-only-specific-file-on-a-folder-tp3696102p3696104.html

Hi Zhengyu,

Just get all your file names as an array using getFileList() and the
loop on all names to detect the last three characters of the names
using substring(name, 0, LengthOf(name)-4) (I could I've messed the
indexes !). Store that as a new extensions[] array and then put your
whole macro in a for+if loop (loop an all extensions, test if
extension is .tif).

Sorry I don't have a macro at hand that does that to give you the code
directly...

Christophe

On Fri, May 30, 2008 at 6:05 AM, Pang, Zhengyu (GE, Research)
<[hidden email]> wrote:

> Dear all,
>
> I have made a macro to batch process images under a folder. But some
> files are not images and I need to ignore these files. How do I do it? I
> have used a function of getFileList() to read all files, but how do I
> ignore some files ending with".zvd" OR ".archive"? Thanks for your help.
>
> Zhengyu
>
>>               g Global Research Center
>>
>> ______________________________________________________________________
>>
>>           Zhengyu Pang, Ph.D.
>                        Bioanalytics and Protein Science Laboratory
>                        Biosciences Global Technology Organization
>>               One Research Circle, K1 5B37A
>>               Niskayuna, NY12309
>>               * [hidden email]
>>               *(518) 387-4015
>>
>>
>