Finding missing sequence files in a folder

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
cgcollecterx
Posts: 2
Joined: 09 Apr 2011 10:58

Finding missing sequence files in a folder

Post 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

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Finding missing sequence files in a folder

Post 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 :)
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Finding missing sequence files in a folder

Post 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.

cgcollecterx
Posts: 2
Joined: 09 Apr 2011 10:58

Re: Finding missing sequence files in a folder

Post 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.

admin
Site Admin
Posts: 67270
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Finding missing sequence files in a folder

Post 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?

Post Reply