Page 1 of 1

Finding missing sequence files in a folder

Posted: 16 Jul 2011 08:09
by cgcollecterx
Any available script to Finding missing sequence files in a folder.

For example,
DSLR0001.jpg
...
DSLR0004.jpg
DSLR0006.jpg
....
DSLR1999.jpg

output
missing DSLR0005.jpg

Re: Finding missing sequence files in a folder

Posted: 16 Jul 2011 11:28
by zer0
Welcome,

It's possible to create such a script. My suggestion would be for you to strip away the repeated text part. At the same time, start an internal counter. Then compare the value of what's left after stripping DSLR, for example, with your internal counter. If they are different, add to list and carry onto the next item. At the end, display that list.

Cheers :)

Re: Finding missing sequence files in a folder

Posted: 16 Jul 2011 12:03
by Stefan
Hi and welcome to the community.

cgcollecterx wrote:Any available script to Finding missing sequence files in a folder.

For example,
DSLR0001.jpg
...
DSLR0004.jpg
DSLR0006.jpg
....
DSLR1999.jpg

output
missing DSLR0005.jpg

For example check out this script:
(For an how-to execute an script please see my footer)

Code: Select all

   ////// automatically select all files:
   //sel f;


   ////// get the selected file names:
   ////// We use:  get name part only without extension, delimited by an : colon. "1" means: collect only the selected files.
   $SelectedFiles = report("{BaseName}:",1);

   
   ////// only work if there are files selected:
   //  end $SelectedFiles == "" , "Please select a few files first.";


   ////// if the name part contain also numbers, like e.g. Vacation2011_pic1978.jpg,
   ////// you may remove this part before checking the counter:
   $NamePart="DSLR";
   $SelectedFiles = replace($SelectedFiles, $NamePart, "");
     
  

   ////// initializing for our while loop:
   $startNum=1;      //start checking counter at number n
   $endNumbe=20;     //last counter n to check for
   $missedNum="";    //just init the array
   

     //////automatic for $endNumbe:
    //////last file from $SelectedFiles should have the highest number, so we take this as $endNumbe
    //$posLastDelimiter = gettoken($SelectedFiles, "count", ":") -1; 
    //$lastFile = gettoken($SelectedFiles, $posLastDelimiter, ":"); 
   //msg $lastFile;  
   //$endNumbe = $lastFile;

    
   
   ////// For Each Number Between StartNumber and EndNumber Do:
   while($startNum <= $endNumbe){
         $currNum = format($startNum, "0000"); 
         $found = strpos($SelectedFiles, $currNum);
         if ($found < 0){$missedNum = $missedNum . $currNum . "<crlf>";}
   $startNum++;
   }

   
     
   ////// test output:
    text $missedNum;

This gives you,

for an file list like:

Code: Select all

DSLR0001.jpg
DSLR0002.jpg
DSLR0004.jpg
DSLR0005.jpg
DSLR0006.jpg
DSLR0008.jpg
DSLR0009.jpg
DSLR0010.jpg
DSLR0021.jpg
...this text box:

Code: Select all

0003
0007
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020



Instead of the TEXT command you can do other things too, just check out the help of XYplorer (or ask)



HTH? :D

If yes, spread the word about XYplorer.

Re: Finding missing sequence files in a folder

Posted: 18 Jul 2011 19:17
by cgcollecterx
thank it help me a lot!
that is y i always recommend xyplorer, xy actually only got 1 drawback, it may crash when the xplorer2 work fine for windows xp that always have default windows explorer clash problem.

Re: Finding missing sequence files in a folder

Posted: 18 Jul 2011 19:48
by admin
cgcollecterx wrote:thank it help me a lot!
that is y i always recommend xyplorer, xy actually only got 1 drawback, it may crash when the xplorer2 work fine for windows xp that always have default windows explorer clash problem.
hä?

XYplorer does not crash AFAIK on any windows version. When does it crash at your place?