Saturday, January 11, 2020

windows 7 - Automatically extract and rename extracted file according to archive's name

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.

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...