Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a bunch of zip files in a folder. Each zip file has a file in it named exp_1.txt. I would like to unzip each zip file and rename the extracted file from each zip file to what the zip file was named.

The zip files names don't follow any pattern or date structure, but are all different. I have figured out how to get the exp_1.txt file extracted into the same directory as the zip file, but can't figure out the renaming of exp_1.txt to match what the zip file it was extracted from is named.

Once again in fewer words: from TuesdayReport.zip I want to extract the only file exp_1.txt and rename it to TuesdayReport.txt in the same directory as TuesdayReport.zip.

Currently I'm using 7z x to extract the file to the same directory the zip file is located in. I would prefer to be able to run this from a batch file.

share|improve this question
    
On which operating system? –  Daniel Andersson Feb 27 '13 at 20:09
    
Windows 7 64 bit sorry for leaving that out originally. –  Carrie Feb 27 '13 at 20:29
    
I can get it to name a folder the same name and put the file in that folder, but this really doesn't help me as the file is still named exp_1.txt and it just created a directory for it, any other options? –  Carrie Feb 27 '13 at 21:41
add comment

1 Answer

why not using 7zip command line edition, that you can download from here?

inside this zip file you can find a help file in CHm format that has all switches and commands that can help you during your batch process.

share|improve this answer
    
I can get it to name a folder the same name and put the file in that folder, but this really doesn't help me as the file is still named exp_1.txt and it just created a directory for it, any other options? –  Carrie Feb 27 '13 at 21:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.