One approach is to let your operating system mount the zip file as a directory. Then the problem reduces to applying the transformation to all the files in that directory (and its subdirectories).
Most modern Unix systems (including Linux and OS X) support FUSE, which allows user code to implement filesystems. For example, you can use [fuse-zip]:
Create an empty directory where the zip file will be mounted.
mkdir mnt
Mount the zip file to that directory.
fuse-zip foo.zip mnt
Read and modify files in mnt
as desired.
When you're done, unmount the zip file from the directory.
fusermount -u mnt
An alternative to fuse-zip is archivemount. Windows has a somewhat similar feature that allows mounting a zip file as a drive with third-party software.
To act on all the files in a directory tree, you can use :args
and :argdo
.
:args mnt/**/*
:argdo %s/foo/bar/g | update