topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 13, 2024, 10:36 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: automate delete files from a .7z archive  (Read 9714 times)

3dpinballchamp

  • Participant
  • Joined in 2012
  • *
  • Posts: 7
    • View Profile
    • Donate to Member
IDEA: automate delete files from a .7z archive
« on: March 22, 2012, 05:30 AM »
i want to delete certain files from 7zip archives,
i have a list of files to delete, any way to automate the task?
thanks

db90h

  • Coding Snacks Author
  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 481
  • Software Engineer
    • View Profile
    • Bitsum - Take control of your PC
    • Read more about this member.
    • Donate to Member
Re: IDEA: automate delete files from a .7z archive
« Reply #1 on: March 22, 2012, 06:42 AM »
Yes, simple. Use the command line version of 7z, named 7z.exe. Then with a simple command to it (run it to get help) you can delete files from the archive. Create a batch file if you need to do more than one operation.

3dpinballchamp

  • Participant
  • Joined in 2012
  • *
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: automate delete files from a .7z archive
« Reply #2 on: March 22, 2012, 09:40 AM »
how can i use it for the task? all the 7z files are in one folder and the list doesnot

db90h

  • Coding Snacks Author
  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 481
  • Software Engineer
    • View Profile
    • Bitsum - Take control of your PC
    • Read more about this member.
    • Donate to Member
Re: IDEA: automate delete files from a .7z archive
« Reply #3 on: March 22, 2012, 10:18 AM »
I am sure someone here has the time to explain it to ya.. there are multiple people more than qualified. It's really very easy stuff at the command line. I wish I had more time, sorry. If I do get more time, I'll try to help. It is doable though, and easier than you think.

If you have multiple files to work on, a BATCH file with a file based loop will work great. There are plenty of BATCH experts here I'm sure.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: IDEA: automate delete files from a .7z archive
« Reply #4 on: March 22, 2012, 11:09 AM »
What sort of format is the list of files to delete in?  One filename per line?  Is the path included?  If possible, can you post a snippet of the file?

3dpinballchamp

  • Participant
  • Joined in 2012
  • *
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: automate delete files from a .7z archive
« Reply #5 on: March 22, 2012, 11:17 AM »
First Seven Zip Archive
File 0001
File 0002
File 0003
File 0004
File 0005

Another Seven Zip Archive
MoreFiles 0001
MoreFiles 0002
MoreFiles 0003
MoreFiles 0004
MoreFiles 0005

the entire list is like that, also all the files are the same file-format.
it is in alphabetical order.