How can I extract every file in a zip archive that contains more than one file with the same name/path?
I have a zip file which contains multiple files that have the same filename (and there are no subfolders). These are in fact different files: they have unique sizes and content, and are "duplicates" in name, only. My question is, how can I extract them all without one overwriting another? Neither WinRAR nor PowerArchiver seems able to do this automatically (both stop after only extracting three files, unless I say it's OK to overwrite). If I manually extract the files one at a time, it only extracts the most recently added file with a given name; yet I know, based on the overall size of the archive, that the data for the other files is in there. So I tried renaming the files while still in the zip (I copied the zip first); it took 10 minutes to rename one file, and ended up renaming both (though the unique sizes were retained)! I am at a loss as to how to proceed, please help.
EDIT: Problem solved! Whereas WinRAR and PowerArchiver failed hard, a free little open source program called 7-Zip was able to accomplish the extraction without a hitch.
windows-7 windows
|
show 7 more comments
I have a zip file which contains multiple files that have the same filename (and there are no subfolders). These are in fact different files: they have unique sizes and content, and are "duplicates" in name, only. My question is, how can I extract them all without one overwriting another? Neither WinRAR nor PowerArchiver seems able to do this automatically (both stop after only extracting three files, unless I say it's OK to overwrite). If I manually extract the files one at a time, it only extracts the most recently added file with a given name; yet I know, based on the overall size of the archive, that the data for the other files is in there. So I tried renaming the files while still in the zip (I copied the zip first); it took 10 minutes to rename one file, and ended up renaming both (though the unique sizes were retained)! I am at a loss as to how to proceed, please help.
EDIT: Problem solved! Whereas WinRAR and PowerArchiver failed hard, a free little open source program called 7-Zip was able to accomplish the extraction without a hitch.
windows-7 windows
How in the world did you create an archive having files with the same name?
– grawity
Dec 28 '13 at 9:48
1
One obvious possibility is that the archive was created on a Unix-like system, where filenames with differences in case are considered different, but Guest is trying to extract on a Windows system or a Mac where they are considered to be identical.
– Jules
Dec 28 '13 at 9:58
Simple: some of the files were added to the archive later, after it was already created. ZIP programs will let you do that. (I didn't do it, myself; some moron did. I am trying to recover his work.)
– Guest
Dec 28 '13 at 10:17
1
@Guest Have you tried 7-zip? It has an automatic rename feature during extracting when it detects duplicate filenames. I just tested it and it works perfect. Choose extract to directory and when it gives the screen to overwrite choose "Auto rename". Both versions are extracted correctly (with one named with_1after it). Also 7zip does give you the opportunity to extract the correct file (the one you select) and not just the first/last version it encounters.
– Rik
Dec 28 '13 at 23:39
1
@Rik YES! IT WORKED! Problem solved. :D Thank you, so much. (A free program last updated in 2010? So much for owning the paid-for latest version of PowerArchiver. . . .)
– Guest
Dec 29 '13 at 0:03
|
show 7 more comments
I have a zip file which contains multiple files that have the same filename (and there are no subfolders). These are in fact different files: they have unique sizes and content, and are "duplicates" in name, only. My question is, how can I extract them all without one overwriting another? Neither WinRAR nor PowerArchiver seems able to do this automatically (both stop after only extracting three files, unless I say it's OK to overwrite). If I manually extract the files one at a time, it only extracts the most recently added file with a given name; yet I know, based on the overall size of the archive, that the data for the other files is in there. So I tried renaming the files while still in the zip (I copied the zip first); it took 10 minutes to rename one file, and ended up renaming both (though the unique sizes were retained)! I am at a loss as to how to proceed, please help.
EDIT: Problem solved! Whereas WinRAR and PowerArchiver failed hard, a free little open source program called 7-Zip was able to accomplish the extraction without a hitch.
windows-7 windows
I have a zip file which contains multiple files that have the same filename (and there are no subfolders). These are in fact different files: they have unique sizes and content, and are "duplicates" in name, only. My question is, how can I extract them all without one overwriting another? Neither WinRAR nor PowerArchiver seems able to do this automatically (both stop after only extracting three files, unless I say it's OK to overwrite). If I manually extract the files one at a time, it only extracts the most recently added file with a given name; yet I know, based on the overall size of the archive, that the data for the other files is in there. So I tried renaming the files while still in the zip (I copied the zip first); it took 10 minutes to rename one file, and ended up renaming both (though the unique sizes were retained)! I am at a loss as to how to proceed, please help.
EDIT: Problem solved! Whereas WinRAR and PowerArchiver failed hard, a free little open source program called 7-Zip was able to accomplish the extraction without a hitch.
windows-7 windows
windows-7 windows
edited Dec 29 '13 at 0:07
Guest
asked Dec 28 '13 at 9:34
GuestGuest
1113
1113
How in the world did you create an archive having files with the same name?
– grawity
Dec 28 '13 at 9:48
1
One obvious possibility is that the archive was created on a Unix-like system, where filenames with differences in case are considered different, but Guest is trying to extract on a Windows system or a Mac where they are considered to be identical.
– Jules
Dec 28 '13 at 9:58
Simple: some of the files were added to the archive later, after it was already created. ZIP programs will let you do that. (I didn't do it, myself; some moron did. I am trying to recover his work.)
– Guest
Dec 28 '13 at 10:17
1
@Guest Have you tried 7-zip? It has an automatic rename feature during extracting when it detects duplicate filenames. I just tested it and it works perfect. Choose extract to directory and when it gives the screen to overwrite choose "Auto rename". Both versions are extracted correctly (with one named with_1after it). Also 7zip does give you the opportunity to extract the correct file (the one you select) and not just the first/last version it encounters.
– Rik
Dec 28 '13 at 23:39
1
@Rik YES! IT WORKED! Problem solved. :D Thank you, so much. (A free program last updated in 2010? So much for owning the paid-for latest version of PowerArchiver. . . .)
– Guest
Dec 29 '13 at 0:03
|
show 7 more comments
How in the world did you create an archive having files with the same name?
– grawity
Dec 28 '13 at 9:48
1
One obvious possibility is that the archive was created on a Unix-like system, where filenames with differences in case are considered different, but Guest is trying to extract on a Windows system or a Mac where they are considered to be identical.
– Jules
Dec 28 '13 at 9:58
Simple: some of the files were added to the archive later, after it was already created. ZIP programs will let you do that. (I didn't do it, myself; some moron did. I am trying to recover his work.)
– Guest
Dec 28 '13 at 10:17
1
@Guest Have you tried 7-zip? It has an automatic rename feature during extracting when it detects duplicate filenames. I just tested it and it works perfect. Choose extract to directory and when it gives the screen to overwrite choose "Auto rename". Both versions are extracted correctly (with one named with_1after it). Also 7zip does give you the opportunity to extract the correct file (the one you select) and not just the first/last version it encounters.
– Rik
Dec 28 '13 at 23:39
1
@Rik YES! IT WORKED! Problem solved. :D Thank you, so much. (A free program last updated in 2010? So much for owning the paid-for latest version of PowerArchiver. . . .)
– Guest
Dec 29 '13 at 0:03
How in the world did you create an archive having files with the same name?
– grawity
Dec 28 '13 at 9:48
How in the world did you create an archive having files with the same name?
– grawity
Dec 28 '13 at 9:48
1
1
One obvious possibility is that the archive was created on a Unix-like system, where filenames with differences in case are considered different, but Guest is trying to extract on a Windows system or a Mac where they are considered to be identical.
– Jules
Dec 28 '13 at 9:58
One obvious possibility is that the archive was created on a Unix-like system, where filenames with differences in case are considered different, but Guest is trying to extract on a Windows system or a Mac where they are considered to be identical.
– Jules
Dec 28 '13 at 9:58
Simple: some of the files were added to the archive later, after it was already created. ZIP programs will let you do that. (I didn't do it, myself; some moron did. I am trying to recover his work.)
– Guest
Dec 28 '13 at 10:17
Simple: some of the files were added to the archive later, after it was already created. ZIP programs will let you do that. (I didn't do it, myself; some moron did. I am trying to recover his work.)
– Guest
Dec 28 '13 at 10:17
1
1
@Guest Have you tried 7-zip? It has an automatic rename feature during extracting when it detects duplicate filenames. I just tested it and it works perfect. Choose extract to directory and when it gives the screen to overwrite choose "Auto rename". Both versions are extracted correctly (with one named with
_1 after it). Also 7zip does give you the opportunity to extract the correct file (the one you select) and not just the first/last version it encounters.– Rik
Dec 28 '13 at 23:39
@Guest Have you tried 7-zip? It has an automatic rename feature during extracting when it detects duplicate filenames. I just tested it and it works perfect. Choose extract to directory and when it gives the screen to overwrite choose "Auto rename". Both versions are extracted correctly (with one named with
_1 after it). Also 7zip does give you the opportunity to extract the correct file (the one you select) and not just the first/last version it encounters.– Rik
Dec 28 '13 at 23:39
1
1
@Rik YES! IT WORKED! Problem solved. :D Thank you, so much. (A free program last updated in 2010? So much for owning the paid-for latest version of PowerArchiver. . . .)
– Guest
Dec 29 '13 at 0:03
@Rik YES! IT WORKED! Problem solved. :D Thank you, so much. (A free program last updated in 2010? So much for owning the paid-for latest version of PowerArchiver. . . .)
– Guest
Dec 29 '13 at 0:03
|
show 7 more comments
3 Answers
3
active
oldest
votes
You could try using infozip's unzip command line utility. It has an option -B to create a backup of any file overwritten during extraction, which might let you get two files out with the same name. You can download it from http://www.info-zip.org/.
If that doesn't work, it should be possible to write a program fairly easily using (for example) the Java java.util.zip.ZipInputStream class that steps through the file and extracts duplicate entries with new names. If you don't have the skill to do this yourself, there are various freelance hiring web sites with numerous programmers who could do it for not very much money.
Thank you! I know someone who should be able to write such a program, so I have asked him if he will do so for me. I'll let you know if it works.
– Guest
Dec 28 '13 at 10:36
FYI, 7-Zip was able to accomplish it without a hitch. (Thanks again, Rik!)
– Guest
Dec 29 '13 at 0:05
add a comment |
You could try extracting the files one-by-one and then renaming after each extract. For that keep a DOS/CMD command ready (to rename newly created files) and a DOS/CMD window open to rename each new file possibly by appending a character at the end.
As I mentioned, when I drag them out one at a time it only pulls the file that was most recently added to the archive (so even though I manually rename the files, they are duplicates anyway). I can see the different data in there, but I can't get to it either automatically or manually.
– Guest
Dec 28 '13 at 20:52
add a comment |
I’m still not sure how this situation even arises (where an archive can have multiple files with the same fully-qualified path and name)—it doesn’t make sense because the existing file should be updated/replaced instead of a new one being added.
Regardless, whenever I run into it, I simply get around it by using the auto-rename function that some archivers have. When you extract such an archive, the program will extract the first file with that name, then when it detects a collision on subsequent files, it will prompt you what you want to do. Most programs will offer the choice to ignore and move on or to overwrite, but some programs such as 7-Zip and WinRAR will let you rename the file and/or automatically rename all files with name collisions.
7-Zip (figure 1) will append an underscore with an incrementing number to the filename (e.g., foobar_1.txt, foobar_2.txt, etc.) while WinRAR (figure 2) will append a parenthesized incrementing number (e.g., foobar(1).txt, foobar(2).txt, etc.)
Figure 1 7-Zip’s filename-collision prompt

Figure 2 WinRAR’s filename-collision prompt

Figure 3 Resulting filenames

Doh! I guess I shouldn’t have stopped typing the answer for a couple of hours to have dinner and watch TV; it seems the answer I was typing has already been addressed in that time. Regardless, I’d already made screenshots, so I didn’t want them to go to waste.:^Þ
– Synetech
Dec 29 '13 at 1:37
Thanks for the informative reply! You summed up the whole issue quite nicely, problem fix and all. FYI though, WinRAR was the first program I tried, and I selected that option, but it didn't work! 7-Zip worked like a charm, but it's the only program I tried that worked. shrug (Edit: In their defense, it may be because I have an old version.)
– Guest
Dec 29 '13 at 5:33
WinRAR was the first program I tried, and I selected that option, but it didn't workCurious; that function has been present for a long time. Which rename button did you use?
– Synetech
Dec 29 '13 at 13:29
@Guest You might want to accept this answer as it does answer your question (and we wouldn't want to leave the question "open").
– Rik
Dec 30 '13 at 23:14
(For the record, it has always annoyed me that 7Zip does not have a Rename option, only a Rename All option. I’ve been frustrated by that limitation on numerous occasions.ಠ_ಠ)
– Synetech
Dec 31 '13 at 1:39
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f694078%2fhow-can-i-extract-every-file-in-a-zip-archive-that-contains-more-than-one-file-w%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You could try using infozip's unzip command line utility. It has an option -B to create a backup of any file overwritten during extraction, which might let you get two files out with the same name. You can download it from http://www.info-zip.org/.
If that doesn't work, it should be possible to write a program fairly easily using (for example) the Java java.util.zip.ZipInputStream class that steps through the file and extracts duplicate entries with new names. If you don't have the skill to do this yourself, there are various freelance hiring web sites with numerous programmers who could do it for not very much money.
Thank you! I know someone who should be able to write such a program, so I have asked him if he will do so for me. I'll let you know if it works.
– Guest
Dec 28 '13 at 10:36
FYI, 7-Zip was able to accomplish it without a hitch. (Thanks again, Rik!)
– Guest
Dec 29 '13 at 0:05
add a comment |
You could try using infozip's unzip command line utility. It has an option -B to create a backup of any file overwritten during extraction, which might let you get two files out with the same name. You can download it from http://www.info-zip.org/.
If that doesn't work, it should be possible to write a program fairly easily using (for example) the Java java.util.zip.ZipInputStream class that steps through the file and extracts duplicate entries with new names. If you don't have the skill to do this yourself, there are various freelance hiring web sites with numerous programmers who could do it for not very much money.
Thank you! I know someone who should be able to write such a program, so I have asked him if he will do so for me. I'll let you know if it works.
– Guest
Dec 28 '13 at 10:36
FYI, 7-Zip was able to accomplish it without a hitch. (Thanks again, Rik!)
– Guest
Dec 29 '13 at 0:05
add a comment |
You could try using infozip's unzip command line utility. It has an option -B to create a backup of any file overwritten during extraction, which might let you get two files out with the same name. You can download it from http://www.info-zip.org/.
If that doesn't work, it should be possible to write a program fairly easily using (for example) the Java java.util.zip.ZipInputStream class that steps through the file and extracts duplicate entries with new names. If you don't have the skill to do this yourself, there are various freelance hiring web sites with numerous programmers who could do it for not very much money.
You could try using infozip's unzip command line utility. It has an option -B to create a backup of any file overwritten during extraction, which might let you get two files out with the same name. You can download it from http://www.info-zip.org/.
If that doesn't work, it should be possible to write a program fairly easily using (for example) the Java java.util.zip.ZipInputStream class that steps through the file and extracts duplicate entries with new names. If you don't have the skill to do this yourself, there are various freelance hiring web sites with numerous programmers who could do it for not very much money.
edited Dec 28 '13 at 9:56
answered Dec 28 '13 at 9:49
JulesJules
351315
351315
Thank you! I know someone who should be able to write such a program, so I have asked him if he will do so for me. I'll let you know if it works.
– Guest
Dec 28 '13 at 10:36
FYI, 7-Zip was able to accomplish it without a hitch. (Thanks again, Rik!)
– Guest
Dec 29 '13 at 0:05
add a comment |
Thank you! I know someone who should be able to write such a program, so I have asked him if he will do so for me. I'll let you know if it works.
– Guest
Dec 28 '13 at 10:36
FYI, 7-Zip was able to accomplish it without a hitch. (Thanks again, Rik!)
– Guest
Dec 29 '13 at 0:05
Thank you! I know someone who should be able to write such a program, so I have asked him if he will do so for me. I'll let you know if it works.
– Guest
Dec 28 '13 at 10:36
Thank you! I know someone who should be able to write such a program, so I have asked him if he will do so for me. I'll let you know if it works.
– Guest
Dec 28 '13 at 10:36
FYI, 7-Zip was able to accomplish it without a hitch. (Thanks again, Rik!)
– Guest
Dec 29 '13 at 0:05
FYI, 7-Zip was able to accomplish it without a hitch. (Thanks again, Rik!)
– Guest
Dec 29 '13 at 0:05
add a comment |
You could try extracting the files one-by-one and then renaming after each extract. For that keep a DOS/CMD command ready (to rename newly created files) and a DOS/CMD window open to rename each new file possibly by appending a character at the end.
As I mentioned, when I drag them out one at a time it only pulls the file that was most recently added to the archive (so even though I manually rename the files, they are duplicates anyway). I can see the different data in there, but I can't get to it either automatically or manually.
– Guest
Dec 28 '13 at 20:52
add a comment |
You could try extracting the files one-by-one and then renaming after each extract. For that keep a DOS/CMD command ready (to rename newly created files) and a DOS/CMD window open to rename each new file possibly by appending a character at the end.
As I mentioned, when I drag them out one at a time it only pulls the file that was most recently added to the archive (so even though I manually rename the files, they are duplicates anyway). I can see the different data in there, but I can't get to it either automatically or manually.
– Guest
Dec 28 '13 at 20:52
add a comment |
You could try extracting the files one-by-one and then renaming after each extract. For that keep a DOS/CMD command ready (to rename newly created files) and a DOS/CMD window open to rename each new file possibly by appending a character at the end.
You could try extracting the files one-by-one and then renaming after each extract. For that keep a DOS/CMD command ready (to rename newly created files) and a DOS/CMD window open to rename each new file possibly by appending a character at the end.
answered Dec 28 '13 at 14:45
ShivanandShivanand
2614
2614
As I mentioned, when I drag them out one at a time it only pulls the file that was most recently added to the archive (so even though I manually rename the files, they are duplicates anyway). I can see the different data in there, but I can't get to it either automatically or manually.
– Guest
Dec 28 '13 at 20:52
add a comment |
As I mentioned, when I drag them out one at a time it only pulls the file that was most recently added to the archive (so even though I manually rename the files, they are duplicates anyway). I can see the different data in there, but I can't get to it either automatically or manually.
– Guest
Dec 28 '13 at 20:52
As I mentioned, when I drag them out one at a time it only pulls the file that was most recently added to the archive (so even though I manually rename the files, they are duplicates anyway). I can see the different data in there, but I can't get to it either automatically or manually.
– Guest
Dec 28 '13 at 20:52
As I mentioned, when I drag them out one at a time it only pulls the file that was most recently added to the archive (so even though I manually rename the files, they are duplicates anyway). I can see the different data in there, but I can't get to it either automatically or manually.
– Guest
Dec 28 '13 at 20:52
add a comment |
I’m still not sure how this situation even arises (where an archive can have multiple files with the same fully-qualified path and name)—it doesn’t make sense because the existing file should be updated/replaced instead of a new one being added.
Regardless, whenever I run into it, I simply get around it by using the auto-rename function that some archivers have. When you extract such an archive, the program will extract the first file with that name, then when it detects a collision on subsequent files, it will prompt you what you want to do. Most programs will offer the choice to ignore and move on or to overwrite, but some programs such as 7-Zip and WinRAR will let you rename the file and/or automatically rename all files with name collisions.
7-Zip (figure 1) will append an underscore with an incrementing number to the filename (e.g., foobar_1.txt, foobar_2.txt, etc.) while WinRAR (figure 2) will append a parenthesized incrementing number (e.g., foobar(1).txt, foobar(2).txt, etc.)
Figure 1 7-Zip’s filename-collision prompt

Figure 2 WinRAR’s filename-collision prompt

Figure 3 Resulting filenames

Doh! I guess I shouldn’t have stopped typing the answer for a couple of hours to have dinner and watch TV; it seems the answer I was typing has already been addressed in that time. Regardless, I’d already made screenshots, so I didn’t want them to go to waste.:^Þ
– Synetech
Dec 29 '13 at 1:37
Thanks for the informative reply! You summed up the whole issue quite nicely, problem fix and all. FYI though, WinRAR was the first program I tried, and I selected that option, but it didn't work! 7-Zip worked like a charm, but it's the only program I tried that worked. shrug (Edit: In their defense, it may be because I have an old version.)
– Guest
Dec 29 '13 at 5:33
WinRAR was the first program I tried, and I selected that option, but it didn't workCurious; that function has been present for a long time. Which rename button did you use?
– Synetech
Dec 29 '13 at 13:29
@Guest You might want to accept this answer as it does answer your question (and we wouldn't want to leave the question "open").
– Rik
Dec 30 '13 at 23:14
(For the record, it has always annoyed me that 7Zip does not have a Rename option, only a Rename All option. I’ve been frustrated by that limitation on numerous occasions.ಠ_ಠ)
– Synetech
Dec 31 '13 at 1:39
add a comment |
I’m still not sure how this situation even arises (where an archive can have multiple files with the same fully-qualified path and name)—it doesn’t make sense because the existing file should be updated/replaced instead of a new one being added.
Regardless, whenever I run into it, I simply get around it by using the auto-rename function that some archivers have. When you extract such an archive, the program will extract the first file with that name, then when it detects a collision on subsequent files, it will prompt you what you want to do. Most programs will offer the choice to ignore and move on or to overwrite, but some programs such as 7-Zip and WinRAR will let you rename the file and/or automatically rename all files with name collisions.
7-Zip (figure 1) will append an underscore with an incrementing number to the filename (e.g., foobar_1.txt, foobar_2.txt, etc.) while WinRAR (figure 2) will append a parenthesized incrementing number (e.g., foobar(1).txt, foobar(2).txt, etc.)
Figure 1 7-Zip’s filename-collision prompt

Figure 2 WinRAR’s filename-collision prompt

Figure 3 Resulting filenames

Doh! I guess I shouldn’t have stopped typing the answer for a couple of hours to have dinner and watch TV; it seems the answer I was typing has already been addressed in that time. Regardless, I’d already made screenshots, so I didn’t want them to go to waste.:^Þ
– Synetech
Dec 29 '13 at 1:37
Thanks for the informative reply! You summed up the whole issue quite nicely, problem fix and all. FYI though, WinRAR was the first program I tried, and I selected that option, but it didn't work! 7-Zip worked like a charm, but it's the only program I tried that worked. shrug (Edit: In their defense, it may be because I have an old version.)
– Guest
Dec 29 '13 at 5:33
WinRAR was the first program I tried, and I selected that option, but it didn't workCurious; that function has been present for a long time. Which rename button did you use?
– Synetech
Dec 29 '13 at 13:29
@Guest You might want to accept this answer as it does answer your question (and we wouldn't want to leave the question "open").
– Rik
Dec 30 '13 at 23:14
(For the record, it has always annoyed me that 7Zip does not have a Rename option, only a Rename All option. I’ve been frustrated by that limitation on numerous occasions.ಠ_ಠ)
– Synetech
Dec 31 '13 at 1:39
add a comment |
I’m still not sure how this situation even arises (where an archive can have multiple files with the same fully-qualified path and name)—it doesn’t make sense because the existing file should be updated/replaced instead of a new one being added.
Regardless, whenever I run into it, I simply get around it by using the auto-rename function that some archivers have. When you extract such an archive, the program will extract the first file with that name, then when it detects a collision on subsequent files, it will prompt you what you want to do. Most programs will offer the choice to ignore and move on or to overwrite, but some programs such as 7-Zip and WinRAR will let you rename the file and/or automatically rename all files with name collisions.
7-Zip (figure 1) will append an underscore with an incrementing number to the filename (e.g., foobar_1.txt, foobar_2.txt, etc.) while WinRAR (figure 2) will append a parenthesized incrementing number (e.g., foobar(1).txt, foobar(2).txt, etc.)
Figure 1 7-Zip’s filename-collision prompt

Figure 2 WinRAR’s filename-collision prompt

Figure 3 Resulting filenames

I’m still not sure how this situation even arises (where an archive can have multiple files with the same fully-qualified path and name)—it doesn’t make sense because the existing file should be updated/replaced instead of a new one being added.
Regardless, whenever I run into it, I simply get around it by using the auto-rename function that some archivers have. When you extract such an archive, the program will extract the first file with that name, then when it detects a collision on subsequent files, it will prompt you what you want to do. Most programs will offer the choice to ignore and move on or to overwrite, but some programs such as 7-Zip and WinRAR will let you rename the file and/or automatically rename all files with name collisions.
7-Zip (figure 1) will append an underscore with an incrementing number to the filename (e.g., foobar_1.txt, foobar_2.txt, etc.) while WinRAR (figure 2) will append a parenthesized incrementing number (e.g., foobar(1).txt, foobar(2).txt, etc.)
Figure 1 7-Zip’s filename-collision prompt

Figure 2 WinRAR’s filename-collision prompt

Figure 3 Resulting filenames

edited Dec 29 '13 at 1:39
answered Dec 29 '13 at 1:33
SynetechSynetech
57.3k29184319
57.3k29184319
Doh! I guess I shouldn’t have stopped typing the answer for a couple of hours to have dinner and watch TV; it seems the answer I was typing has already been addressed in that time. Regardless, I’d already made screenshots, so I didn’t want them to go to waste.:^Þ
– Synetech
Dec 29 '13 at 1:37
Thanks for the informative reply! You summed up the whole issue quite nicely, problem fix and all. FYI though, WinRAR was the first program I tried, and I selected that option, but it didn't work! 7-Zip worked like a charm, but it's the only program I tried that worked. shrug (Edit: In their defense, it may be because I have an old version.)
– Guest
Dec 29 '13 at 5:33
WinRAR was the first program I tried, and I selected that option, but it didn't workCurious; that function has been present for a long time. Which rename button did you use?
– Synetech
Dec 29 '13 at 13:29
@Guest You might want to accept this answer as it does answer your question (and we wouldn't want to leave the question "open").
– Rik
Dec 30 '13 at 23:14
(For the record, it has always annoyed me that 7Zip does not have a Rename option, only a Rename All option. I’ve been frustrated by that limitation on numerous occasions.ಠ_ಠ)
– Synetech
Dec 31 '13 at 1:39
add a comment |
Doh! I guess I shouldn’t have stopped typing the answer for a couple of hours to have dinner and watch TV; it seems the answer I was typing has already been addressed in that time. Regardless, I’d already made screenshots, so I didn’t want them to go to waste.:^Þ
– Synetech
Dec 29 '13 at 1:37
Thanks for the informative reply! You summed up the whole issue quite nicely, problem fix and all. FYI though, WinRAR was the first program I tried, and I selected that option, but it didn't work! 7-Zip worked like a charm, but it's the only program I tried that worked. shrug (Edit: In their defense, it may be because I have an old version.)
– Guest
Dec 29 '13 at 5:33
WinRAR was the first program I tried, and I selected that option, but it didn't workCurious; that function has been present for a long time. Which rename button did you use?
– Synetech
Dec 29 '13 at 13:29
@Guest You might want to accept this answer as it does answer your question (and we wouldn't want to leave the question "open").
– Rik
Dec 30 '13 at 23:14
(For the record, it has always annoyed me that 7Zip does not have a Rename option, only a Rename All option. I’ve been frustrated by that limitation on numerous occasions.ಠ_ಠ)
– Synetech
Dec 31 '13 at 1:39
Doh! I guess I shouldn’t have stopped typing the answer for a couple of hours to have dinner and watch TV; it seems the answer I was typing has already been addressed in that time. Regardless, I’d already made screenshots, so I didn’t want them to go to waste.
:^Þ– Synetech
Dec 29 '13 at 1:37
Doh! I guess I shouldn’t have stopped typing the answer for a couple of hours to have dinner and watch TV; it seems the answer I was typing has already been addressed in that time. Regardless, I’d already made screenshots, so I didn’t want them to go to waste.
:^Þ– Synetech
Dec 29 '13 at 1:37
Thanks for the informative reply! You summed up the whole issue quite nicely, problem fix and all. FYI though, WinRAR was the first program I tried, and I selected that option, but it didn't work! 7-Zip worked like a charm, but it's the only program I tried that worked. shrug (Edit: In their defense, it may be because I have an old version.)
– Guest
Dec 29 '13 at 5:33
Thanks for the informative reply! You summed up the whole issue quite nicely, problem fix and all. FYI though, WinRAR was the first program I tried, and I selected that option, but it didn't work! 7-Zip worked like a charm, but it's the only program I tried that worked. shrug (Edit: In their defense, it may be because I have an old version.)
– Guest
Dec 29 '13 at 5:33
WinRAR was the first program I tried, and I selected that option, but it didn't work Curious; that function has been present for a long time. Which rename button did you use?– Synetech
Dec 29 '13 at 13:29
WinRAR was the first program I tried, and I selected that option, but it didn't work Curious; that function has been present for a long time. Which rename button did you use?– Synetech
Dec 29 '13 at 13:29
@Guest You might want to accept this answer as it does answer your question (and we wouldn't want to leave the question "open").
– Rik
Dec 30 '13 at 23:14
@Guest You might want to accept this answer as it does answer your question (and we wouldn't want to leave the question "open").
– Rik
Dec 30 '13 at 23:14
(For the record, it has always annoyed me that 7Zip does not have a Rename option, only a Rename All option. I’ve been frustrated by that limitation on numerous occasions.
ಠ_ಠ)– Synetech
Dec 31 '13 at 1:39
(For the record, it has always annoyed me that 7Zip does not have a Rename option, only a Rename All option. I’ve been frustrated by that limitation on numerous occasions.
ಠ_ಠ)– Synetech
Dec 31 '13 at 1:39
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f694078%2fhow-can-i-extract-every-file-in-a-zip-archive-that-contains-more-than-one-file-w%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
How in the world did you create an archive having files with the same name?
– grawity
Dec 28 '13 at 9:48
1
One obvious possibility is that the archive was created on a Unix-like system, where filenames with differences in case are considered different, but Guest is trying to extract on a Windows system or a Mac where they are considered to be identical.
– Jules
Dec 28 '13 at 9:58
Simple: some of the files were added to the archive later, after it was already created. ZIP programs will let you do that. (I didn't do it, myself; some moron did. I am trying to recover his work.)
– Guest
Dec 28 '13 at 10:17
1
@Guest Have you tried 7-zip? It has an automatic rename feature during extracting when it detects duplicate filenames. I just tested it and it works perfect. Choose extract to directory and when it gives the screen to overwrite choose "Auto rename". Both versions are extracted correctly (with one named with
_1after it). Also 7zip does give you the opportunity to extract the correct file (the one you select) and not just the first/last version it encounters.– Rik
Dec 28 '13 at 23:39
1
@Rik YES! IT WORKED! Problem solved. :D Thank you, so much. (A free program last updated in 2010? So much for owning the paid-for latest version of PowerArchiver. . . .)
– Guest
Dec 29 '13 at 0:03