I have a folder containing many .zip
files. They are named like this:
John-Rupert A. Doe_nnnnnnn_assignsubmission_file_*.zip
where n
is a digit, *
is a string and John-Rupert A. Doe
is a string that may contain spaces, dots and dashes.
For each of them, I want to do the following:
create a directory. I do this via:
ls | cut -d'_' -f 1 | sed 's/ //g' | tr -d '.' | tr -d '-' | xargs -L 1 mkdir
(So, the corresponding directory name for the example above would be
JohnRupertADoe
)Now I want to extract each
.zip
file into the directory created using this.zip
file name. But how?