The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Applications (http://hintsforums.macworld.com/forumdisplay.php?f=5)
-   -   Extracting multiple zip files into same directory? (http://hintsforums.macworld.com/showthread.php?t=106487)

flextone 10-20-2009 07:33 AM

Extracting multiple zip files into same directory?
 
This is driving me crazy. I'm trying to extract a file split into several zip archives. All the programs I've tried are extracting each zip to a separate folder do I need to start collecting them. None of these apps have the option to not create a folder. I've tried unarchiver, betterzip, zipeg, and the osx zip utility.

Isn't there a solution for this without using the terminal?

fracai 10-20-2009 10:42 AM

What format exactly is the zip? What information do you get from "Get Info" or running the 'file' command.

Was the file split prior to zipping? In this case you'll need to extract everything and then recombine the file, probably with 'cat' or something like Split&Concat.

Was the zip itself split after compression? Here the zip program should handle the multi-part archive. The fact that this hasn't happened leads me to believe that the split occurred on the file rather than the archive.

Las_Vegas 10-20-2009 01:10 PM

Doing it from terminal would be a lot easier and could be done with wildcards (batch). But, you didn't want that solution…

flextone 10-20-2009 02:56 PM

Each zip contains a rar file, which together form the file. When using winzip or winrar in windows this never caused me any problems. Why can't two files be unzipped to the same place?

Las_Vegas 10-20-2009 05:59 PM

Code:

# cd <path to zip files>
# unzip * -d <destination directory>


flextone 10-22-2009 07:34 AM

Geez guys,

So there's no way of doing this simple task without the terminal?

Las_Vegas 10-22-2009 10:39 AM

You could write a bash script to do it... Likewise, so could an Automator script.

tw 10-22-2009 10:47 AM

both Archive Utility and Stuffit Expander have the ability to specify destination folders and enclosing folders - check their preferences (Archive utility lives in /System/Library/CoreServices). also, if you find the program that made and split the zips in the first place, it ought to recognize its own work and recombine the files (assuming, of course, that the person who did the zipping in the first place didn't split the files manually, of course).

flextone 10-23-2009 06:50 AM

I have "into same directory as archive" selected in "expand to", the problem is it creates a folder for each zip, and there's no setting for not creating this folder.

benwiggy 10-23-2009 07:33 AM

The alternative is to let the extractor extract them where it wants to, and then automate the collation of all the files into one location.

tw 10-23-2009 10:15 AM

Quote:

Originally Posted by flextone (Post 558442)
I have "into same directory as archive" selected in "expand to", the problem is it creates a folder for each zip, and there's no setting for not creating this folder.

which application are you talking about?

JCP21 10-23-2009 12:21 PM

There must be a mac version of winrar or similar?

Las_Vegas 10-23-2009 12:33 PM

Quote:

Originally Posted by JCP21 (Post 558487)
There must be a mac version of winrar or similar?

MacPAR deLuxe

blubbernaut 10-23-2009 07:53 PM

The Unarchiver

There's a couple of others at versiontracker.com too.
But I think The Unarchiver does what you want.

flextone 10-24-2009 06:38 AM

I've tried Unarchiver and it's the same issue as with the osx archive utility. They create a folder for each zip. Macpar Deluxe doesn't do zip's as far as I gathered.

Is this only bothering me? Has no one encountered this?

fracai 10-24-2009 10:16 AM

I think you're the only one who has encountered a download where the packager was ... "creative" ... enough to individually zip the already compressed segments of a RAR archive. This is the kind of bonehead move that makes me question the source of your download.

Your quickest solution is going to be to extract each zip file into their individual folders and then use Automator or the command line to move the resulting RARs into a common folder. ( mv -i */*.rar ./ ) Then unrar the files with any RAR supporting extractor. And as a final action, berate your packager.

EatsWithFingers 10-24-2009 10:47 AM

The folder which is "created" is already part of the archive. That is, in your case, the RAR archive has been put in a folder, then that folder zipped.

I've just checked (using 10.5.8), and creating a RAR archive, zipping it, then double-clicking on the zip file does not create a folder (i.e. the original RAR file appears in the same directory as the zip file).

This means that, to get the behaviour you desire, the unzipping program will have to have an option to discard the top-level directory if one exists. Since it seems like a rare edge-case, I don't find it surprising that no utilities have that option (and as others have mentioned, it's trivial to get round using a couple of basic Terminal commands).

tw 10-24-2009 11:04 AM

I have to agree with fracai and eatswithfingers here. either you have your decompression app misconfigured or the person creating these archives is doing it the wrong way. my guess would be that they are opening the folder and compressing the contents of the folder, rather than compressing the folder itself; some compression apps will will make separate compressed items under those circumstances. assuming it's a problem with the source, and this happens to you often enough to worry about, you'll either need to email the provider and tell him to package the files correctly, or you'll need to write a script to reorganize the files as tehy are decompressed.

flextone 10-26-2009 12:27 PM

Fracai, my sources are indeed questionable, and I will say no more...

EatsWithFingers, I think you'll find that when trying to unzip several zips at once they will be extracted to separate folders without any option to do otherwise in the app's prefs.

EatsWithFingers 10-26-2009 03:57 PM

Quote:

Originally Posted by flextone (Post 558926)
EatsWithFingers, I think you'll find that when trying to unzip several zips at once they will be extracted to separate folders ...

Nope. Just tried it (by highlighting three zip archives then pressing Cmd+Down). No folders are created; the RAR archives appeared in the same directory as the ZIP files.

What does the following command output on your system? (assuming you're not completely adverse to using the Terminal...)

Code:

$> unzip -l <ZIP_FILE>

flextone 11-06-2009 03:14 AM

I get the following syntax error

-bash: syntax error near unexpected token `newline'

Las_Vegas 11-06-2009 03:22 AM

Yes. You would get that if you entered the line verbatim.

I believe EatsWithFingers meant that you enter into terminal the words "unzip -l " (without the quotes) followed by the name of your zip file. After entering the above text including the space at the end, simply drag your zip file from Finder into the Terminal window to address it by its full path.

EatsWithFingers 11-06-2009 09:53 AM

Quote:

Originally Posted by Las_Vegas (Post 560328)
I believe EatsWithFingers meant that you enter into terminal the words "unzip -l " (without the quotes) followed by the name of your zip file. After entering the above text including the space at the end, simply drag your zip file from Finder into the Terminal window to address it by its full path.

Exactly. Sorry for not being clear enough in my post - I didn't have the time to explain that "$>" signified the prompt and "<ZIP_FILE>" meant the file name of your zip file.

The command lists the contents of the zip file and will show us whether or not the zip archive contains just the RAR file, or if it contains a folder with a RAR file.

flextone 11-07-2009 11:05 AM

Length Date Time Name
-------- ---- ---- ----
2931712 05-22-08 23:14 bbl.rar
410 05-22-08 23:14 file_id.diz



This happens with every file split into several zips, not a specific file.

EatsWithFingers 11-08-2009 10:25 AM

Quote:

Originally Posted by flextone (Post 558926)
EatsWithFingers, I think you'll find that when trying to unzip several zips at once they will be extracted to separate folders without any option to do otherwise in the app's prefs.

You're right, sorry. If the zip archive contains more than one file, a folder will be created containing the archive contents. My earlier test used archives containing only a single file, hence the different behaviour.

There is a solution to your problem though: Zipeg. If you uncheck "Append archive name to the destination" in the preferences, no folder will be created. Note: you cannot extract multiple archives at once with Zipeg, but it does support multi-part archives.

(Aside: Info about file_id.diz for interested parties)

flextone 11-08-2009 04:30 PM

Thanks for hanging in there EatsWithFingers throughout this topic.
If zipeg doesn't support extracting multiple archives at once, I'd rather use the terminal :)

hallelujahtalon 11-10-2009 12:52 AM

Automator or AppleScript
 
Quote:

Originally Posted by Las_Vegas (Post 558118)
Code:

# cd <path to zip files>
# unzip * -d <destination directory>


Thanks for the hint. Is it possible to make automator or apple script action from this?

merlynwylld 11-11-2009 07:57 PM

questionable sources are sometimes the oldest sources
 
[QUOTE=flextone;558926]Fracai, my sources are indeed questionable, and I will say no more...

Yes, I'm familiar with that source, odd in a way how many aren't, newsgroups seem to be used more by the older computer crowd ;) But the solution to your problem lies in Stuffit Deluxe 2010, in the extraction prefs you just uncheck create enclosing folder, and move zips to trash and your just left with the rar's and bunch of .nfo files and brag tags. This question drove me nuts cause I was one of those things that was problem, then wasn't, now its back and I couldn't remember the solution. All most as an omen of reading this I read about a fellow that wrote an Automator Script that handled it. I looked at that last week thinking I should get that and look at it. Thought I had, couldn't find it on my computer or the original link anywhere I tried. I'm googled out. Maybe some one else can find it!
As to the why of this crazy practice to split rar files that are then individually zipped is a protection scheme. That all started in the Windows groups as a way to protect segments, Zip files where easier to repair. This is before Par files came into use. It's a pain if you see something you want to look at. Expanding the zips into folders then dragging the rars all together in one folder was a major chore. Another thing I think the recursive compression was for was to defeat virus and trojan scanners. So any file done that way is on a quarantine level until ClamXav can be used to scan it. Why the practice is still being done is just inertia now I believe, I haven't found nearly as many infected ones as I used too either, so why continue it?

shailentj 12-15-2011 06:41 PM

Hello guys,

Sorry for waking an old thread. I have just bought a MacBook Pro for my grandmother. She can use computers for basic tasks, such as Email, Viewing photos and other very basic things.

She has a set of zip archives. Each zip archive contains a .rar file. When you have all the .rar files, you can extract all and get one folder of pictures.

Please do not ask why someone has put .rar files in a zip file.

I come from Windows, and I find life way to intuitive and easy over there. On Mac, it is very hard. The guy at the Apple AppStore said that Macs are easier to use than Windows. My grandmother spent a couple of hours looking for the Delete Key on the MBP when I told her to delete unnecessary files on her desktop. Anyway, that is not the issue tonight.

In Windows, I right-click on all the .zip files, and say "Extract Here" and I get the .rar files in one folder.

In Mac, I get a folder for each extracted .zip file.

My grandmother does not know any terminal commands, let alone bash programming.

Who anybody provide help?

BorisR 05-24-2014 07:11 PM

Using The Unarchiver
 
Decompress the RAR file with The Unarchiver.
The resulting folder will have multiple ZIP files.
Go to Preferences and under "Create a new folder for the extracted files:" choose Never.
Select all ZIP files, right-click and choose Open with The Unarchiver.
Voilá.
:D


All times are GMT -5. The time now is 09:14 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.