I have about 100 folders with different .7z files. I want to extract all the .7z files' subdirectories (skipping the parent directory) into Z://New Extract folder. If files/folders exist, it overwrites without prompting
Example of now:
├───Steven Folder
│ Steven.7z (parent folder is Steven and has subdirectories of Pictures and Resume)
│
├───John Jacobs Folder
│ John Jacobs.7z (parent folder is John Jacobs and has subdirectories of Pictures and reports)
│
└───Jay Cloud Folder
Jay Cloud .7z
Example of what the new extracted structer would be:
I don't think so, but you can solve your problem with batch or bash programming, maybe also by using python or powershell and using the cmdline utility of 7z.
Last edit: HITCHER 2023-02-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can first xtract all 7z files into the same temporary folder (tempfolder),
so first create tempfolder and destfolder, extract there all your Zip files,
then run this bash program with parameters tempfolder and destfolder.
It is possible to create another bash program, which travels through your directories to find Zip files, and then xtract them to ./tempfolder automatically.
should work like this (did not test):
#!/bin/bashSAVEIFS=$IFSIFS=$(echo-en"\n\b")functionfind7z(){forfilein$(ls"$1")doif[[!-d${1}/${file}]];then`echo" ${1}/${file}"|grep-q.7z-`if[$?==0];thenecho" ${1}/${file} is a 7z file"7zzx${1}/${file}-o"$2"fielsefind7z"${1}/${file}""$2"fidone}functionmain(){find7z"$1""$2"}
main"$1""$2"IFS=$SAVEIFS
./find7z ./searchfolder ./tempfolder
Last edit: HITCHER 2023-02-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I finally had time to play with the suggested script, but there were just too many discrepancies within the .7z files. Each .7z file seemed to have a different parent directory so What i have done is extract all 200+ .7z files, cleaned up the directories and removed all previous parent directories and re .7z compressed them using a numeric prefix within their own directory. So what I have now is
├───001 Steven Folder
│ 001 Steven.7z
│
├───002 John Jacobs Folder
│ 002 John Jacobs.7z
│
└───003 Jay Cloud Folder
003 Jay Cloud .7z
Now that I have everything this way, I only need to extract all .7z files in cronological order autoomatically overwrite into a directory R:/Master Unzipped/
I would like to do this while keeping the .7 files in their directroy. Is this possible or do I need to have them all in the same directory?
Last edit: skyline killer 2023-03-23
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have about 100 folders with different .7z files. I want to extract all the .7z files' subdirectories (skipping the parent directory) into Z://New Extract folder. If files/folders exist, it overwrites without prompting
Example of now:
Example of what the new extracted structer would be:
Can .7z do this?
Last edit: skyline killer 2023-02-18
I don't think so, but you can solve your problem with batch or bash programming, maybe also by using python or powershell and using the cmdline utility of 7z.
Last edit: HITCHER 2023-02-21
Would you care to help me offline on this.
You can first xtract all 7z files into the same temporary folder (tempfolder),
so first create tempfolder and destfolder, extract there all your Zip files,
then run this bash program with parameters tempfolder and destfolder.
./cp-subf ./tempfolder ./destfolder
After that remove temporary folder.
It is possible to create another bash program, which travels through your directories to find Zip files, and then xtract them to ./tempfolder automatically.
should work like this (did not test):
./find7z ./searchfolder ./tempfolder
Last edit: HITCHER 2023-02-22
Don't laugh please...How do I run this in Win 11? This isn't a bat correct? Its bash?
So if you want to run this on windows, you will need WSL.
https://learn.microsoft.com/en-us/windows/wsl/install
Thank you Hitcher, let me play with this a little.
I finally had time to play with the suggested script, but there were just too many discrepancies within the .7z files. Each .7z file seemed to have a different parent directory so What i have done is extract all 200+ .7z files, cleaned up the directories and removed all previous parent directories and re .7z compressed them using a numeric prefix within their own directory. So what I have now is
Now that I have everything this way, I only need to extract all .7z files in cronological order autoomatically overwrite into a directory R:/Master Unzipped/
I would like to do this while keeping the .7 files in their directroy. Is this possible or do I need to have them all in the same directory?
Last edit: skyline killer 2023-03-23