LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-08-2018, 03:50 AM   #1
Michael Uplawski
Member
 
Registered: Dec 2015
Location: Outside, most of the time.
Posts: 966
Blog Entries: 26

Rep: Reputation: 558Reputation: 558Reputation: 558Reputation: 558Reputation: 558Reputation: 558
IGNORE, I'm dumb: Better zip than zip -9


You can read on, but first my solution: Remove all but the very first new-line, remove all white-space between XML-tags and the file will be smaller... imagine.

Good morning.

This is not a time-traveling thread and won't bring you back to the 1990s, meaning: I can compress better than that. And I do not need recommendations for file-compressors, other than those which create zip-files.

But today I generated an OOXML word-processor document and removed all that has no function in that document, xml-code from styles, anything that I do not need in document.xml and all the unnecessary files and sub-folders. In the end I have the folder “word” with two xml-files, styles.xml and document.xml.

Using
Code:
zip -9r new_doc word
my result is a functional document file, but its size is the double of what the word-processor creates, while including all the stuff that I had previously deleted!

So, somewhere in the process of storing a document from the word-processor, zip-compression is used, but the algorithm appears to be much better than (my) zip -9.

Do you know a compressor which creates zip and does compress better than zip ?

TIA

Michael

P.S. Test case: http://www.uplawski.eu/Test-files/test_files.zip. My file is new_test.tmdx, the text-processor creates test.tmdx. You can unzip them to see what I mean.

Last edited by Michael Uplawski; 12-08-2018 at 04:46 AM. Reason: Files added
 
Old 12-09-2018, 07:40 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,809
Blog Entries: 9

Rep: Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637
maybe the command syntax is wrong?
maybe "zip -9r" won't work, but "zip -9 -r" will?
 
Old 12-09-2018, 04:40 PM   #3
Michael Uplawski
Member
 
Registered: Dec 2015
Location: Outside, most of the time.
Posts: 966

Original Poster
Blog Entries: 26

Rep: Reputation: 558Reputation: 558Reputation: 558Reputation: 558Reputation: 558Reputation: 558
Quote:
Originally Posted by ondoho View Post
maybe the command syntax is wrong?
maybe "zip -9r" won't work, but "zip -9 -r" will?
No, that is all okay. As stated in the very first sentence, above, it was sufficient to just remove the useless white-space. This way I reduce a (very small) document from 16k to 1.3k, when zipped.

It is an obvious thing to do, but I had forgotten. The text-processors which save as OOXML do this routinely, or never write white-space where it is unnecessary. Only for manipulations in XML, I prefer to first apply a proper indentation to render it readable. This is enough to bloat up the document.

I am not sure, if it makes sense to keep this thread around, in case that anybody stumbles over the same phenomenon.., i.e. makes the same dumb mistake as I did. Else “ignore, I am dumb” will just suffice...
 
  


Reply

Tags
compression, ooxml, zip


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I have zip -d file.zip "__MACOSX*" work on all zip files in directory? thomwblair Linux - Newbie 10 10-08-2018 03:30 PM
LXer: Cheaper than most, better than all: the 2013 Nexus 7 reviewed LXer Syndicated Linux News 0 08-01-2013 02:11 PM
uncompress .zip with "tar -ixz Filename.zip" , can it be done ??? htetnaing Linux - Newbie 2 08-17-2008 06:10 AM
Zip gives error "-bash: /usr/bin/zip: Argument list too long" konathamsrinu Programming 3 07-06-2006 11:08 AM
create a self-extracting zip file with zip on solaris? samsolaris Solaris / OpenSolaris 3 10-15-2004 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration