DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

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

3dpinballchamp

  • Participant
  • Joined in 2012
  • *
  • Posts: 7
IDEA: automate delete files from a .7z archive
« on: March 22, 2012, 10: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
  • ***
  • Posts: 481
    • Coding Snacks
    • Military Service Badge - US Army
    • Linux User
Re: IDEA: automate delete files from a .7z archive
« Reply #1 on: March 22, 2012, 11: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
Re: IDEA: automate delete files from a .7z archive
« Reply #2 on: March 22, 2012, 02:40 PM »
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
  • ***
  • Posts: 481
    • Coding Snacks
    • Military Service Badge - US Army
    • Linux User
Re: IDEA: automate delete files from a .7z archive
« Reply #3 on: March 22, 2012, 03:18 PM »
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

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: IDEA: automate delete files from a .7z archive
« Reply #4 on: March 22, 2012, 04:09 PM »
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
Re: IDEA: automate delete files from a .7z archive
« Reply #5 on: March 22, 2012, 04:17 PM »
Code
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.

Original address: https://www.donationcoder.com/forum/index.php?topic=30398.0