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.elmodule 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-extractmust be set to
archive-zip-updatemust be set to
<dami at cpan.org>