Batch to unzip, add text file and rezip
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I have created 200 zip files for work, but I realized I forgot to add the .txt to each of them. Instead of spending hours redoing this work I'd appreciate any help.
Is there a way anyone knows using bash that will unzip, add the .txt file and rezip all 200 files? The name of the .txt file will not change just the .zip files.
Thank you.
bash ssh batch
New contributor
TinyTim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
2
down vote
favorite
I have created 200 zip files for work, but I realized I forgot to add the .txt to each of them. Instead of spending hours redoing this work I'd appreciate any help.
Is there a way anyone knows using bash that will unzip, add the .txt file and rezip all 200 files? The name of the .txt file will not change just the .zip files.
Thank you.
bash ssh batch
New contributor
TinyTim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
Imho this is about a default Ubuntu tool and thus on-topic.
– RoVo
1 hour ago
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have created 200 zip files for work, but I realized I forgot to add the .txt to each of them. Instead of spending hours redoing this work I'd appreciate any help.
Is there a way anyone knows using bash that will unzip, add the .txt file and rezip all 200 files? The name of the .txt file will not change just the .zip files.
Thank you.
bash ssh batch
New contributor
TinyTim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I have created 200 zip files for work, but I realized I forgot to add the .txt to each of them. Instead of spending hours redoing this work I'd appreciate any help.
Is there a way anyone knows using bash that will unzip, add the .txt file and rezip all 200 files? The name of the .txt file will not change just the .zip files.
Thank you.
bash ssh batch
bash ssh batch
New contributor
TinyTim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
TinyTim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 58 mins ago


Yufenyuy Veyeh Dider
829822
829822
New contributor
TinyTim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 hours ago


TinyTim
132
132
New contributor
TinyTim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
TinyTim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
TinyTim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
Imho this is about a default Ubuntu tool and thus on-topic.
– RoVo
1 hour ago
add a comment |Â
1
Imho this is about a default Ubuntu tool and thus on-topic.
– RoVo
1 hour ago
1
1
Imho this is about a default Ubuntu tool and thus on-topic.
– RoVo
1 hour ago
Imho this is about a default Ubuntu tool and thus on-topic.
– RoVo
1 hour ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
You don't even need to unzip the files, you can update an existing file:
zip -u existing.zip file.txt
from zip
manual:
update (-u)
Update existing entries if newer on the file system and add new files.
If the archive does not exist issue warning then create a new archive.
If you want to add a complete folder, add -r
.
To update a number of zip files, do something like this:
for z in *.zip; do
zip -u "$z" file.txt
done
See this related question on U&L.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
You don't even need to unzip the files, you can update an existing file:
zip -u existing.zip file.txt
from zip
manual:
update (-u)
Update existing entries if newer on the file system and add new files.
If the archive does not exist issue warning then create a new archive.
If you want to add a complete folder, add -r
.
To update a number of zip files, do something like this:
for z in *.zip; do
zip -u "$z" file.txt
done
See this related question on U&L.
add a comment |Â
up vote
3
down vote
accepted
You don't even need to unzip the files, you can update an existing file:
zip -u existing.zip file.txt
from zip
manual:
update (-u)
Update existing entries if newer on the file system and add new files.
If the archive does not exist issue warning then create a new archive.
If you want to add a complete folder, add -r
.
To update a number of zip files, do something like this:
for z in *.zip; do
zip -u "$z" file.txt
done
See this related question on U&L.
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
You don't even need to unzip the files, you can update an existing file:
zip -u existing.zip file.txt
from zip
manual:
update (-u)
Update existing entries if newer on the file system and add new files.
If the archive does not exist issue warning then create a new archive.
If you want to add a complete folder, add -r
.
To update a number of zip files, do something like this:
for z in *.zip; do
zip -u "$z" file.txt
done
See this related question on U&L.
You don't even need to unzip the files, you can update an existing file:
zip -u existing.zip file.txt
from zip
manual:
update (-u)
Update existing entries if newer on the file system and add new files.
If the archive does not exist issue warning then create a new archive.
If you want to add a complete folder, add -r
.
To update a number of zip files, do something like this:
for z in *.zip; do
zip -u "$z" file.txt
done
See this related question on U&L.
edited 1 hour ago
answered 1 hour ago
RoVo
5,6991237
5,6991237
add a comment |Â
add a comment |Â
TinyTim is a new contributor. Be nice, and check out our Code of Conduct.
TinyTim is a new contributor. Be nice, and check out our Code of Conduct.
TinyTim is a new contributor. Be nice, and check out our Code of Conduct.
TinyTim is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1079177%2fbatch-to-unzip-add-text-file-and-rezip%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Imho this is about a default Ubuntu tool and thus on-topic.
– RoVo
1 hour ago