how to recursively 7z files of the same name only with small variants on the file name?












-1















I'm having problems zipping a whole lot of files (around 20,000) into 7z using the terminal.



I have files stacked up like this:



Very Very Similar File.ext
Very Very Similar File (v1).ext
Very Very Similar File (b3).ext
Another Very Very Similar File (d2).ext
Another Very Very Similar File (q3).ext
...


I have been trying to find a command or a way to save the files compressed into 7z for achiving purposes like this:



Very Very Similar File.7z
CONTAINING:
__ Very Very Similar File.ext
___Very Very Similar File (v1).ext
_____Very Very Similar File (b3).ext

Another Very Very Similar File.7z
CONTAINING:
__ Another Very Very Similar File (d2).ext
___Another Very Very Similar File (q3).ext


Each containing their own variants of those similar files, but anything I thought of trying would be too painful and slow to get working.



After a couple tries, I managed to find out a way to compress one group of files together uzing 7z and a wildcard:



7zr a Very Very Similar File*.ext Very Very Similar File.7z



This command produces exactly what I want; zip all the files with the same filename and only slight variations of the file name into one 7z file. I'm having trouble automating this task so it does this exact thing with each group of files in this folder.










share|improve this question

























  • It's very hard to understand the question, please give a better example of the file layout and the commands you used. What approaches have you tried so far?

    – eblock
    Mar 6 at 16:23











  • Sure, sorry. I'm trying to compress all the files that have the same filename on them but are slight variants of each file, and only have really small variations on the file name. I want all those files that are named the same and only have slightly different filenames zipped each one into its own 7z file containing all the slightly different files. I'm purely trying to save space as all these files unzipped take up both a lot of screen space and a lot of physical space on my drive.

    – Webodan
    Mar 6 at 16:26













  • I've added some more clarification on the OP, sorry again I'm bad at explaining this specific problem

    – Webodan
    Mar 6 at 16:34











  • What are the rules for determining if a file is "similar".

    – Stephen Harris
    Mar 6 at 16:39











  • Like I typed in my example, they are similar since they have the exact same file name except for a parenthesis added with a letter and a number in them to distinguish them.

    – Webodan
    Mar 6 at 16:42
















-1















I'm having problems zipping a whole lot of files (around 20,000) into 7z using the terminal.



I have files stacked up like this:



Very Very Similar File.ext
Very Very Similar File (v1).ext
Very Very Similar File (b3).ext
Another Very Very Similar File (d2).ext
Another Very Very Similar File (q3).ext
...


I have been trying to find a command or a way to save the files compressed into 7z for achiving purposes like this:



Very Very Similar File.7z
CONTAINING:
__ Very Very Similar File.ext
___Very Very Similar File (v1).ext
_____Very Very Similar File (b3).ext

Another Very Very Similar File.7z
CONTAINING:
__ Another Very Very Similar File (d2).ext
___Another Very Very Similar File (q3).ext


Each containing their own variants of those similar files, but anything I thought of trying would be too painful and slow to get working.



After a couple tries, I managed to find out a way to compress one group of files together uzing 7z and a wildcard:



7zr a Very Very Similar File*.ext Very Very Similar File.7z



This command produces exactly what I want; zip all the files with the same filename and only slight variations of the file name into one 7z file. I'm having trouble automating this task so it does this exact thing with each group of files in this folder.










share|improve this question

























  • It's very hard to understand the question, please give a better example of the file layout and the commands you used. What approaches have you tried so far?

    – eblock
    Mar 6 at 16:23











  • Sure, sorry. I'm trying to compress all the files that have the same filename on them but are slight variants of each file, and only have really small variations on the file name. I want all those files that are named the same and only have slightly different filenames zipped each one into its own 7z file containing all the slightly different files. I'm purely trying to save space as all these files unzipped take up both a lot of screen space and a lot of physical space on my drive.

    – Webodan
    Mar 6 at 16:26













  • I've added some more clarification on the OP, sorry again I'm bad at explaining this specific problem

    – Webodan
    Mar 6 at 16:34











  • What are the rules for determining if a file is "similar".

    – Stephen Harris
    Mar 6 at 16:39











  • Like I typed in my example, they are similar since they have the exact same file name except for a parenthesis added with a letter and a number in them to distinguish them.

    – Webodan
    Mar 6 at 16:42














-1












-1








-1








I'm having problems zipping a whole lot of files (around 20,000) into 7z using the terminal.



I have files stacked up like this:



Very Very Similar File.ext
Very Very Similar File (v1).ext
Very Very Similar File (b3).ext
Another Very Very Similar File (d2).ext
Another Very Very Similar File (q3).ext
...


I have been trying to find a command or a way to save the files compressed into 7z for achiving purposes like this:



Very Very Similar File.7z
CONTAINING:
__ Very Very Similar File.ext
___Very Very Similar File (v1).ext
_____Very Very Similar File (b3).ext

Another Very Very Similar File.7z
CONTAINING:
__ Another Very Very Similar File (d2).ext
___Another Very Very Similar File (q3).ext


Each containing their own variants of those similar files, but anything I thought of trying would be too painful and slow to get working.



After a couple tries, I managed to find out a way to compress one group of files together uzing 7z and a wildcard:



7zr a Very Very Similar File*.ext Very Very Similar File.7z



This command produces exactly what I want; zip all the files with the same filename and only slight variations of the file name into one 7z file. I'm having trouble automating this task so it does this exact thing with each group of files in this folder.










share|improve this question
















I'm having problems zipping a whole lot of files (around 20,000) into 7z using the terminal.



I have files stacked up like this:



Very Very Similar File.ext
Very Very Similar File (v1).ext
Very Very Similar File (b3).ext
Another Very Very Similar File (d2).ext
Another Very Very Similar File (q3).ext
...


I have been trying to find a command or a way to save the files compressed into 7z for achiving purposes like this:



Very Very Similar File.7z
CONTAINING:
__ Very Very Similar File.ext
___Very Very Similar File (v1).ext
_____Very Very Similar File (b3).ext

Another Very Very Similar File.7z
CONTAINING:
__ Another Very Very Similar File (d2).ext
___Another Very Very Similar File (q3).ext


Each containing their own variants of those similar files, but anything I thought of trying would be too painful and slow to get working.



After a couple tries, I managed to find out a way to compress one group of files together uzing 7z and a wildcard:



7zr a Very Very Similar File*.ext Very Very Similar File.7z



This command produces exactly what I want; zip all the files with the same filename and only slight variations of the file name into one 7z file. I'm having trouble automating this task so it does this exact thing with each group of files in this folder.







recursive archive 7z p7zip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 6 at 16:44







Webodan

















asked Mar 6 at 16:15









WebodanWebodan

62




62













  • It's very hard to understand the question, please give a better example of the file layout and the commands you used. What approaches have you tried so far?

    – eblock
    Mar 6 at 16:23











  • Sure, sorry. I'm trying to compress all the files that have the same filename on them but are slight variants of each file, and only have really small variations on the file name. I want all those files that are named the same and only have slightly different filenames zipped each one into its own 7z file containing all the slightly different files. I'm purely trying to save space as all these files unzipped take up both a lot of screen space and a lot of physical space on my drive.

    – Webodan
    Mar 6 at 16:26













  • I've added some more clarification on the OP, sorry again I'm bad at explaining this specific problem

    – Webodan
    Mar 6 at 16:34











  • What are the rules for determining if a file is "similar".

    – Stephen Harris
    Mar 6 at 16:39











  • Like I typed in my example, they are similar since they have the exact same file name except for a parenthesis added with a letter and a number in them to distinguish them.

    – Webodan
    Mar 6 at 16:42



















  • It's very hard to understand the question, please give a better example of the file layout and the commands you used. What approaches have you tried so far?

    – eblock
    Mar 6 at 16:23











  • Sure, sorry. I'm trying to compress all the files that have the same filename on them but are slight variants of each file, and only have really small variations on the file name. I want all those files that are named the same and only have slightly different filenames zipped each one into its own 7z file containing all the slightly different files. I'm purely trying to save space as all these files unzipped take up both a lot of screen space and a lot of physical space on my drive.

    – Webodan
    Mar 6 at 16:26













  • I've added some more clarification on the OP, sorry again I'm bad at explaining this specific problem

    – Webodan
    Mar 6 at 16:34











  • What are the rules for determining if a file is "similar".

    – Stephen Harris
    Mar 6 at 16:39











  • Like I typed in my example, they are similar since they have the exact same file name except for a parenthesis added with a letter and a number in them to distinguish them.

    – Webodan
    Mar 6 at 16:42

















It's very hard to understand the question, please give a better example of the file layout and the commands you used. What approaches have you tried so far?

– eblock
Mar 6 at 16:23





It's very hard to understand the question, please give a better example of the file layout and the commands you used. What approaches have you tried so far?

– eblock
Mar 6 at 16:23













Sure, sorry. I'm trying to compress all the files that have the same filename on them but are slight variants of each file, and only have really small variations on the file name. I want all those files that are named the same and only have slightly different filenames zipped each one into its own 7z file containing all the slightly different files. I'm purely trying to save space as all these files unzipped take up both a lot of screen space and a lot of physical space on my drive.

– Webodan
Mar 6 at 16:26







Sure, sorry. I'm trying to compress all the files that have the same filename on them but are slight variants of each file, and only have really small variations on the file name. I want all those files that are named the same and only have slightly different filenames zipped each one into its own 7z file containing all the slightly different files. I'm purely trying to save space as all these files unzipped take up both a lot of screen space and a lot of physical space on my drive.

– Webodan
Mar 6 at 16:26















I've added some more clarification on the OP, sorry again I'm bad at explaining this specific problem

– Webodan
Mar 6 at 16:34





I've added some more clarification on the OP, sorry again I'm bad at explaining this specific problem

– Webodan
Mar 6 at 16:34













What are the rules for determining if a file is "similar".

– Stephen Harris
Mar 6 at 16:39





What are the rules for determining if a file is "similar".

– Stephen Harris
Mar 6 at 16:39













Like I typed in my example, they are similar since they have the exact same file name except for a parenthesis added with a letter and a number in them to distinguish them.

– Webodan
Mar 6 at 16:42





Like I typed in my example, they are similar since they have the exact same file name except for a parenthesis added with a letter and a number in them to distinguish them.

– Webodan
Mar 6 at 16:42










0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504758%2fhow-to-recursively-7z-files-of-the-same-name-only-with-small-variants-on-the-fil%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504758%2fhow-to-recursively-7z-files-of-the-same-name-only-with-small-variants-on-the-fil%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?