Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Detect file sequences in File:Find results

by aes1972 (Initiate)
on Jan 21, 2013 at 01:33 UTC ( #1014369=note: print w/ replies, xml ) Need Help??


in reply to Re: Detect file sequences in File:Find results
in thread Detect file sequences in File:Find results

--->What does the preprocess sub do?

It sorts the directory results so that the unpadded sequences comes back in the correct order. Without it the sequence comes back looking like this:

image_sequenceA.1.tif image_sequenceA.11.tif image_sequenceA.12.tif image_sequenceA.13.tif image_sequenceA.14.tif image_sequenceA.15.tif image_sequenceA.16.tif image_sequenceA.17.tif image_sequenceA.18.tif image_sequenceA.19.tif image_sequenceA.2.tif image_sequenceA.20.tif image_sequenceA.3.tif
Which would make the sequence detection incorrect. It also handles the cases where there are files with the same name but different extension like this:

image_sequenceA.1.tif image_sequenceA.2.tif image_sequenceA.3.tif image_sequenceA.1.exr image_sequenceA.2.exr image_sequenceA.3.exr
So the preprocess sub is necessary in my case unless I can do the same sort somewhere else


Comment on Re^2: Detect file sequences in File:Find results
Select or Download Code
Re^3: Detect file sequences in File:Find results
by johngg (Abbot) on Jan 21, 2013 at 15:38 UTC
    so that the unpadded sequences comes back in the correct order

    You may have a reason for the order you chose but I would have thought it made more sense order things so that the number part of the filename was sorted numerically, not lexically. That way you get two runs rather than one run and four singletons from the example you post.

    image_sequenceA.1.tif image_sequenceA.2.tif image_sequenceA.3.tif image_sequenceA.11.tif image_sequenceA.12.tif image_sequenceA.13.tif image_sequenceA.14.tif image_sequenceA.15.tif image_sequenceA.16.tif image_sequenceA.17.tif image_sequenceA.18.tif image_sequenceA.19.tif image_sequenceA.20.tif

    I hope this is of interest.

    Cheers,

    JohnGG

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1014369]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (16)
As of 2014-07-31 19:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (252 votes), past polls