[clue] Unzipping zip archives with duplicates?

Sean LeBlanc seanleblanc at comcast.net
Tue Aug 28 13:27:22 MDT 2012


On 8/28/12 11:37 AM, David L. Anselmi wrote:
> 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.
>

Actually, they are actually dupes - even within the structure. But yes, 
dropping into something like Perl could help skin this cat.

Currently, my weapon of choice in that department is Ruby, so I'll try 
that. It looks like it might be pretty easy.



More information about the clue mailing list