Showing posts with label compression. Show all posts
Showing posts with label compression. Show all posts

Listing compressed files within a .zip or .rar by file size

I'd like to know any app that shows a list of the files that lie within a compressed file .zip or .rar. If the list could be ordered by file size it'd be great! It could be any software that runs on Windows or Mac OS since I use both OS using Parallels.

Why this is important to me?
The answer is that sometimes I need to send a compressed file to someone and this file generally contains lots of coding files that are part of a Visual Studio Solution/Project for example. I just want to send a subset of those files. There are some big files like DLLs and database files scattered everywhere in a lot of folders that don’t need to go with the compressed file.

So how can I avoid spending time going through all those folders/files, looking their size and deleting one by one to make the final compressed file to be uploaded smaller?

I thought about asking this question at SuperUser. To tell the truth I already had the question typed there but before I could post it and after a few tries by myself I got what I wanted using WinRAR with an easy play of menu commands. So how can you do this? Follow me…

1 - If you don’t know or don’t have WinRAR or use another file archiver, you can get it at:
http://www.rarlab.com/download.htm

I use WinRAR in its evaluation copy incarnation that once in while pops up a dialog asking you to purchase it. Smiley surpreso It works great even if you don’t want to purchase it… take it easy.

2 - At first compress the folders and files you want without getting bothered about the size of the resulting compressed file. After installing WinRAR it’s available in the context menu of any file or folder in Windows Explorer.

3 - Open the compressed file in WinRAR and play with the menu just a little bit. Go to the Options | File list and select Flat folders view and Details menu options.

WinRAR listing the files of a compressed file (trunk.rar) by file size
Figure 1 - WinRAR listing the files of a compressed file (trunk.rar) by file size

Taking the above screenshot into consideration (it lists the content of a trunk project folder compressed), we can see that it has 1554 folders and 1624 files. This compressed file alone has 87 MB in disk when the actual uncompressed content has 193 MB in size but it’s still pretty big to send it over the wire… I have a lot of folders and files to go through if I want to delete the big and unnecessary files to try to decrease the final size! As you see, it also contains many duplicate files in different paths… it’s pretty daunting just to think about a manual scan. A visual scan in a single screen is much better. How do you get a big picture of this compressed file?

4 - Order all the files by size by clicking the size column header.

5 - Select all the files you want to remove/delete from the compressed file in just one go. One can do this in two different ways: clicking a file and holding the ctrl key and clicking another file to select not contiguous files OR selecting one file and pressing the shift key and clicking another file to select contiguous files. After this it’s just a matter of right clicking the file selection and executing the Delete files command.

Hope this useful tip helps you someday!