[clue] Unzipping zip archives with duplicates?
David L. Anselmi
anselmi at anselmi.us
Tue Aug 28 11:37:44 MDT 2012
Sean LeBlanc wrote:
> I'm trying to figure out how I might extract a certain zip file on the
> command line.
>
> Normally, this is a no-brainer, of course, but this one has duplicate
> names in there. Now, some GUI tools will rename dupes found (append .#
> on the end, for example) and keep right on trucking.
Is there any chance the dupes are in different directories? Then you have to recreate the directory
structure so they don't collide (but I'm sure you thought of that).
So you could list out the files and unzip them one at a time. If the file's already been seen
rename it or put it in a different dir.
In Perl there are examples (in the bighorn sheep book if not the camel book) of using a hash to
remove/detect duplicates in a list that happen to count the dupes. That would make adding a number
on the end easy.
HTH,
Dave
More information about the clue
mailing list