Check if multiple zip files (multi-part) exist in a folder












-1















What is the bash syntax for checking if a folder contains a multi-part zip file? as part of a Batch script. If statement is what I would like but struggling.



Test data I am dealing with is roughly like this:



Test_Data
└── test data set 1
| ├── test.data.1a.zip
| ├── test.data.1b.zip
| ├── test.data.1c.zip
| └── test.data.1d.zip
|
├── test data set 2
| ├── test.data.2.zip
| ├── test.data.2.z01
| ├── test.data.2.z02
| ├── test.data.2.z03
| └── test.data.2.z04
|
└── test data set 4
└── test.data.3.zip









share|improve this question

























  • Please show an example which files are present. Are there unrelated files that don't belong to a ZIP file? Can there be several independent multi-part ZIP files? Can there be single-part ZIP files?

    – Bodo
    Feb 12 at 18:17











  • @Bodo data added

    – madmiddle
    Feb 12 at 21:30











  • You didn't answer my questions. If there can be more than one set of multi-part ZIP files or if there can be single-part ZIP files, show an example that has all of these, otherwise state which preconditions can be assumed. What means "roughly like this"? Do the files of a multi-part ZIP always have a number followed by a single letter before the .zip? Or can there be something else? Please also tell us what should be the output: A true/false exit code? A list of the files that belong to a multi-part ZIP? Something else?

    – Bodo
    Feb 13 at 9:34











  • @Bodo looking across the folders on the server it is one set of multi-part zip files per folder so they are not mixed in any way. There is also 2 ways that they seem to be split up as well. some are using the format above and then some are using the format that you are saying: test.data.219.zip test.data.219.z01 test.data.219.z02

    – madmiddle
    Feb 13 at 11:00











  • Please add all clarification or additional information to the question and answer all questions. It is difficult to propose a solution when your reqirements or expectations are not clear.

    – Bodo
    Feb 13 at 11:05
















-1















What is the bash syntax for checking if a folder contains a multi-part zip file? as part of a Batch script. If statement is what I would like but struggling.



Test data I am dealing with is roughly like this:



Test_Data
└── test data set 1
| ├── test.data.1a.zip
| ├── test.data.1b.zip
| ├── test.data.1c.zip
| └── test.data.1d.zip
|
├── test data set 2
| ├── test.data.2.zip
| ├── test.data.2.z01
| ├── test.data.2.z02
| ├── test.data.2.z03
| └── test.data.2.z04
|
└── test data set 4
└── test.data.3.zip









share|improve this question

























  • Please show an example which files are present. Are there unrelated files that don't belong to a ZIP file? Can there be several independent multi-part ZIP files? Can there be single-part ZIP files?

    – Bodo
    Feb 12 at 18:17











  • @Bodo data added

    – madmiddle
    Feb 12 at 21:30











  • You didn't answer my questions. If there can be more than one set of multi-part ZIP files or if there can be single-part ZIP files, show an example that has all of these, otherwise state which preconditions can be assumed. What means "roughly like this"? Do the files of a multi-part ZIP always have a number followed by a single letter before the .zip? Or can there be something else? Please also tell us what should be the output: A true/false exit code? A list of the files that belong to a multi-part ZIP? Something else?

    – Bodo
    Feb 13 at 9:34











  • @Bodo looking across the folders on the server it is one set of multi-part zip files per folder so they are not mixed in any way. There is also 2 ways that they seem to be split up as well. some are using the format above and then some are using the format that you are saying: test.data.219.zip test.data.219.z01 test.data.219.z02

    – madmiddle
    Feb 13 at 11:00











  • Please add all clarification or additional information to the question and answer all questions. It is difficult to propose a solution when your reqirements or expectations are not clear.

    – Bodo
    Feb 13 at 11:05














-1












-1








-1


1






What is the bash syntax for checking if a folder contains a multi-part zip file? as part of a Batch script. If statement is what I would like but struggling.



Test data I am dealing with is roughly like this:



Test_Data
└── test data set 1
| ├── test.data.1a.zip
| ├── test.data.1b.zip
| ├── test.data.1c.zip
| └── test.data.1d.zip
|
├── test data set 2
| ├── test.data.2.zip
| ├── test.data.2.z01
| ├── test.data.2.z02
| ├── test.data.2.z03
| └── test.data.2.z04
|
└── test data set 4
└── test.data.3.zip









share|improve this question
















What is the bash syntax for checking if a folder contains a multi-part zip file? as part of a Batch script. If statement is what I would like but struggling.



Test data I am dealing with is roughly like this:



Test_Data
└── test data set 1
| ├── test.data.1a.zip
| ├── test.data.1b.zip
| ├── test.data.1c.zip
| └── test.data.1d.zip
|
├── test data set 2
| ├── test.data.2.zip
| ├── test.data.2.z01
| ├── test.data.2.z02
| ├── test.data.2.z03
| └── test.data.2.z04
|
└── test data set 4
└── test.data.3.zip






bash shell zip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 13 at 13:41







madmiddle

















asked Feb 12 at 18:09









madmiddlemadmiddle

625




625













  • Please show an example which files are present. Are there unrelated files that don't belong to a ZIP file? Can there be several independent multi-part ZIP files? Can there be single-part ZIP files?

    – Bodo
    Feb 12 at 18:17











  • @Bodo data added

    – madmiddle
    Feb 12 at 21:30











  • You didn't answer my questions. If there can be more than one set of multi-part ZIP files or if there can be single-part ZIP files, show an example that has all of these, otherwise state which preconditions can be assumed. What means "roughly like this"? Do the files of a multi-part ZIP always have a number followed by a single letter before the .zip? Or can there be something else? Please also tell us what should be the output: A true/false exit code? A list of the files that belong to a multi-part ZIP? Something else?

    – Bodo
    Feb 13 at 9:34











  • @Bodo looking across the folders on the server it is one set of multi-part zip files per folder so they are not mixed in any way. There is also 2 ways that they seem to be split up as well. some are using the format above and then some are using the format that you are saying: test.data.219.zip test.data.219.z01 test.data.219.z02

    – madmiddle
    Feb 13 at 11:00











  • Please add all clarification or additional information to the question and answer all questions. It is difficult to propose a solution when your reqirements or expectations are not clear.

    – Bodo
    Feb 13 at 11:05



















  • Please show an example which files are present. Are there unrelated files that don't belong to a ZIP file? Can there be several independent multi-part ZIP files? Can there be single-part ZIP files?

    – Bodo
    Feb 12 at 18:17











  • @Bodo data added

    – madmiddle
    Feb 12 at 21:30











  • You didn't answer my questions. If there can be more than one set of multi-part ZIP files or if there can be single-part ZIP files, show an example that has all of these, otherwise state which preconditions can be assumed. What means "roughly like this"? Do the files of a multi-part ZIP always have a number followed by a single letter before the .zip? Or can there be something else? Please also tell us what should be the output: A true/false exit code? A list of the files that belong to a multi-part ZIP? Something else?

    – Bodo
    Feb 13 at 9:34











  • @Bodo looking across the folders on the server it is one set of multi-part zip files per folder so they are not mixed in any way. There is also 2 ways that they seem to be split up as well. some are using the format above and then some are using the format that you are saying: test.data.219.zip test.data.219.z01 test.data.219.z02

    – madmiddle
    Feb 13 at 11:00











  • Please add all clarification or additional information to the question and answer all questions. It is difficult to propose a solution when your reqirements or expectations are not clear.

    – Bodo
    Feb 13 at 11:05

















Please show an example which files are present. Are there unrelated files that don't belong to a ZIP file? Can there be several independent multi-part ZIP files? Can there be single-part ZIP files?

– Bodo
Feb 12 at 18:17





Please show an example which files are present. Are there unrelated files that don't belong to a ZIP file? Can there be several independent multi-part ZIP files? Can there be single-part ZIP files?

– Bodo
Feb 12 at 18:17













@Bodo data added

– madmiddle
Feb 12 at 21:30





@Bodo data added

– madmiddle
Feb 12 at 21:30













You didn't answer my questions. If there can be more than one set of multi-part ZIP files or if there can be single-part ZIP files, show an example that has all of these, otherwise state which preconditions can be assumed. What means "roughly like this"? Do the files of a multi-part ZIP always have a number followed by a single letter before the .zip? Or can there be something else? Please also tell us what should be the output: A true/false exit code? A list of the files that belong to a multi-part ZIP? Something else?

– Bodo
Feb 13 at 9:34





You didn't answer my questions. If there can be more than one set of multi-part ZIP files or if there can be single-part ZIP files, show an example that has all of these, otherwise state which preconditions can be assumed. What means "roughly like this"? Do the files of a multi-part ZIP always have a number followed by a single letter before the .zip? Or can there be something else? Please also tell us what should be the output: A true/false exit code? A list of the files that belong to a multi-part ZIP? Something else?

– Bodo
Feb 13 at 9:34













@Bodo looking across the folders on the server it is one set of multi-part zip files per folder so they are not mixed in any way. There is also 2 ways that they seem to be split up as well. some are using the format above and then some are using the format that you are saying: test.data.219.zip test.data.219.z01 test.data.219.z02

– madmiddle
Feb 13 at 11:00





@Bodo looking across the folders on the server it is one set of multi-part zip files per folder so they are not mixed in any way. There is also 2 ways that they seem to be split up as well. some are using the format above and then some are using the format that you are saying: test.data.219.zip test.data.219.z01 test.data.219.z02

– madmiddle
Feb 13 at 11:00













Please add all clarification or additional information to the question and answer all questions. It is difficult to propose a solution when your reqirements or expectations are not clear.

– Bodo
Feb 13 at 11:05





Please add all clarification or additional information to the question and answer all questions. It is difficult to propose a solution when your reqirements or expectations are not clear.

– Bodo
Feb 13 at 11:05










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%2f500227%2fcheck-if-multiple-zip-files-multi-part-exist-in-a-folder%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%2f500227%2fcheck-if-multiple-zip-files-multi-part-exist-in-a-folder%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?