This site uses cookies.
Some of these cookies are essential to the operation of the site,
while others help to improve your experience by providing insights into how the site is being used.
For more information, please see the ProZ.com privacy policy.
Suppose I have a zip file named foo.bar, with a file inside it named file.txt. Now suppose I unzip that file so that it creates a subfolder named "foo" that contains the file "file.txt" in it. Then suppose I edit the file.txt file (make chan... See more
Suppose I have a zip file named foo.bar, with a file inside it named file.txt. Now suppose I unzip that file so that it creates a subfolder named "foo" that contains the file "file.txt" in it. Then suppose I edit the file.txt file (make changes to it). Now I want to put that updated file back into the original zip file. And do this 1000 times for 1000 zip files.
Do you know of a program that can do that? If you know of a program with a commandline option to do that, can you please tell me what the command syntax would be?
The online guides for 7-zip suggest that this would work: 7z.exe u foo.bar foo\*.txt ...but that actually creates a folder inside the zip file called "foo", with the file "file.txt" inside that folder (leaving the original file.txt untouched).
Surely there must be a way to unzip a zip file, edit the unzipped file, and then zip it back up again, using commandline. But how?
The contents of this post will automatically be included in the ticket generated. Please add any additional comments or explanation (optional)
Samuel Murray オランダ Local time: 04:07 2006に入会 英語 から アフリカーンス語 + ...
TOPIC STARTER
Okay, got it
May 22, 2019
Samuel Murray wrote: The online guides for 7-zip suggest that this would work: 7z.exe u foo.bar foo\*.txt ...but that actually creates a folder inside the zip file called "foo", with the file "file.txt" inside that folder (leaving the original file.txt untouched).
Got it. 1. You have to specify the full path of the file you want to add to the zip file. 2. You have to use "add", not "update".
Incorrect: "C:\Program Files\7-Zip\7z.exe" u foo.xlz foo\content.xlf (even if the command is run from D:\omegatproject\target\)
Incorrect: "C:\Program Files\7-Zip\7z.exe" u "D:\omegatproject\target\foo.xlz" foo\content.xlf (even if the command is run from D:\omegatproject\target\)
Correct: "C:\Program Files\7-Zip\7z.exe" a "D:\omegatproject\target\foo.xlz" "D:\omegatproject\target\content.xlf"
Subject:
Comment:
The contents of this post will automatically be included in the ticket generated. Please add any additional comments or explanation (optional)
When you replace a file in a .zip, the zip's internal dictionary is extended by entries for the new file. But of course it is impossible to remove dictionary entries which hold for the old file only. So, the compression will be made worse, as well as the unzip speed. Depending on your scenario this can be negligible or not.
The optimal solution is to re-zip all the files in one go. But of course this takes more time.
Subject:
Comment:
The contents of this post will automatically be included in the ticket generated. Please add any additional comments or explanation (optional)
Samuel Murray オランダ Local time: 04:07 2006に入会 英語 から アフリカーンス語 + ...
TOPIC STARTER
@Rolf
May 22, 2019
Rolf Keller wrote: The optimal solution is to re-zip all the files in one go.
The files I work on are small enough for this not to be an issue. So, I don't mind deleting the original zip file and then creating a whole new zip file all over again. But: is there a commandline command that will do that (without having to specify the full path of the zip file and the full path of every individual file that is to be added to the zip file)?
If I delete the original foo.xlz file (since I won't be needing it after unzipping it) and I now have a folder named foo, with a file content.xlf inside it, and I want to end up with a zip file called "foo.xlz" with the file content.xlf directly inside it (not inside a subfolder named "foo"), from where would I run the command, and what would be command be?
Subject:
Comment:
The contents of this post will automatically be included in the ticket generated. Please add any additional comments or explanation (optional)
Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.
Translate faster & easier, using a sophisticated CAT tool built by a translator / developer.
Accept jobs from clients who use Trados, MemoQ, Wordfast & major CAT tools.
Download and start using CafeTran Espresso -- for free