I need a script to extract a file with wildcards from 'all' zipfiles in a folder...

and subfolders.
I have several hundred zipfiles (nearly a year’s worth) from which I need to extract files that fit the following wildcard: wg.odb

I know a bit about scripting but I need this fast and I’d probably spend all day trying to figure it out.

If you can help I’ll be eternally in your debt. Well, actually, no I won’t. But I will be greatful :slight_smile:

Actually. I might be able to get away with using windows’ ability to search within zipfiles… It’s running now. Only time will tell whether I will actually be able to do anything with the results. Last time I did this I got ‘unable to read from source’ errors when trying to copy the files or zip them up into one zipfile.

Nope. Can’t do anything useful with the search results (Nice one Windows give me the ability to search within zipfiles but don’t let me do anything with the results!!)

Extract all files from the zips, then pull out the ones you want and delete the rest.

Um… how?
There are hundreds of zipfiles. I want a shortcut. I don’t want to do this a hundred times and I will QUICKLY fill the HD if I just do an extract all on all files.

Nevermind. I figured it out with an old copy of pkzip25.exe…

The way you’re cussing windows, it sounds like you may have Linux. If so, use:


for file in *.zip ; do unzip "$file" ; mv *.odb /PATH/TO/ANOTHER/FOLDER/; rm *[!.zip?]; done


How about 7-zip?


7z.exe e <Archive name - can use *.zip> -o<Output directory - can skip> <Wildcard> -r

-r is to recurse subdirectories.