Streaming from zip to bz2
I’ve got a massive bunch of zip archives, each of which contains only a single file. And the name of the enclosed file varies. Dealing with these data is painful.
It’d be a lot more convenient if the files were compressed with
bzip2 and had a consistent naming convention. How would you go about making that conversion without actually unpacking the zip archive, finding the name of the enclosed file and then recompressing? Enter
To illustrate, first we create a zip archive with a single file.
Then extract the single file to standard output using
funzip and pipe the results through
Another, more robust, approach is to simply use
-c (extract to stdout) and