Author Topic: [solved] How to delete all files by excluding only those files from the list?  (Read 5460 times)

0 Members and 1 Guest are viewing this topic.

Offline Angelika

  • Sr. Member
  • ****
  • Join Date: Feb 2017
  • Posts: 307
  • Karma: -2
    • View Profile
How to delete all files by excluding only those files from the list?
« Last Edit: March 18, 2018, 03:49:04 am by Angelika »

Offline Boggin

  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Jul 2014
  • Posts: 10182
  • Location: UK
  • Karma: 122
    • View Profile
Re: How to delete all files by excluding only those files from the list?
« Reply #1 on: March 16, 2018, 07:16:48 am »
I would copy & paste that question into a Google search where you will see a number of suggestions.

Offline Angelika

  • Sr. Member
  • ****
  • Join Date: Feb 2017
  • Posts: 307
  • Karma: -2
    • View Profile
Re: How to delete all files by excluding only those files from the list?
« Reply #2 on: March 16, 2018, 08:21:10 am »
How to use it, step by step. I do not understand anything complicated about it.

https://stackoverflow.com/questions/14775672/delete-all-files-and-folders-but-exclude-a-directory

not directory (only files)

Offline Boggin

  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Jul 2014
  • Posts: 10182
  • Location: UK
  • Karma: 122
    • View Profile
Re: How to delete all files by excluding only those files from the list?
« Reply #3 on: March 16, 2018, 08:45:35 am »
Neither did I but there were other links, although I didn't read through them.

Perhaps you should include the type of files you want to exclude in your Google search.

Google can be very helpful but you have to ask it the right questions.

Offline Angelika

  • Sr. Member
  • ****
  • Join Date: Feb 2017
  • Posts: 307
  • Karma: -2
    • View Profile
How to delete all files by excluding only those files from the list?
« Reply #4 on: March 18, 2018, 03:48:50 am »
use regex and express impossible to match. (?!listyouwanttokeep|two|three).
select all thats left and delete.
SOLVED

Offline Boggin

  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Jul 2014
  • Posts: 10182
  • Location: UK
  • Karma: 122
    • View Profile
Good to see that you found something you could use.