On Tue, Jun 24, 2014 at 8:34 AM, mark murphy <[email protected]> wrote:
> What I hope to be able to do is scan the directory, and for each instance > where there are two files where the first 8 characters (TYYYYDDD) are > identical, run a process on those two files and place the output (named > TYYYYDDD) in a new directory. > > I don't know the details of your file system, but I would guess that those files would have some sort of signifier to indicate "this file is the first part of a multi-part image"; "this file is the second part", etc. - maybe the first half has the extension ".001" and the second half has the extension ".002"? If so, I would search for files with the "first part" signifier, and for each one I found I would try to join it with a file with the same base name but the "second part" signifier. If, on the other hand, there's no signifier - just the same date but with a slightly-different timestamp, you can: 1) grab the list of filenames 2) sort it 3) iterate through the list and compare each filename with the previous filename; if the first 8 characters match, you do your processing magic; if not, you move on.
_______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
