How to edit a file in a zip or rar archive?

I have a large archive with files that I need to edit, but I don't want to extract / zip every time. Is there a way to edit the files directly while in the archive? I opened them and when I save it prompts for a location.


7-Zip can do this:

  1. If not already done, would recommend setting the file editor to something better than the Windows standard Notepad, e.g. Notepad++. To do this in 7-Zip, go to Tools -> Options..., select the editor tab and change the "Editor" path (and may as well also change the "View" path) to the relevant executable, e.g. "C:\Program Files (x86)\Notepad++\notepad++.exe" -multiInst. The -multiInst option opens this in a new window - see comment from Simo Kivistö.
  2. Open the archive in 7-Zip.
  3. Locate the file to be edited.
  4. Right-click on the file to edit and select "Edit" (alternative shortcut = F4). Make your changes, save them and close the editor window - 7-Zip will only detect the file has changed when the editor has been closed.
  5. When 7-Zip detects the file has been changed it will display a prompt such as "File 'abc.txt' was modified. Do you want to update it in the archive?". Click on OK and it will then load the changed file back into the zip file, which may take a bit of time.

Simple answer is NO. There's no way to tell how big the resulting file will be after edit so it can't just be stored back in the same place in the zipfile. What you might be able to find is a program that allows you to do the extract/edit/rezip without you having to worry about the details yourself. It would help to specify your environment (OS etc).