zip-x -- Simple zip/unzip utility with extra indentation features for XML members
Extract a member from a ZIP archive, with XML indentation :
zip-x -x <zip_archive_name> <member_name>
# or in more verbose form
zip-x -unzip -xml_indent -archive <zip_archive_name> -member <member_name>
Replace a member into a ZIP archive, removing XML indentation :
zip-x -zip -xml_indent -archive <zip_archive_name> -member <member_name>
This command-line utility extracts a single member from a ZIP archive, or replaces a single member into a ZIP archive. If the member is an XML file, automatic indentation or un-indentation will take place when the -x option is activated.
The motivation for writing this small application was to be able to inspect MsOffice files from within Emacs on a Windows machine. It solves two problems :
unlike most common unzip programs on windows, the contents of the extracted member is piped to STDOUT. This is a requirement of the arc.el module in Emacs to be able to dynamically inspect a ZIP archive;
when the extracted member is an XML file, its content is nicely indented to make it readable by a human; without this feature, contents of MsOffice zipped files is hard to work with because this XML is packed on one single line without any spaces.
To tell Emacs to use this app, you must customize (ESC-x customize-variable) the following variables :
archive-zip-extract must be set to zip-x with options -u and -x.
archive-zip-update must be set to zip-x with options -z and -x.
DAMI, <dami at cpan.org>
<dami at cpan.org>
To install App::Zip::X, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.