Creating a file list, excluding folders
-
- Posts: 30
- Joined: Tue Apr 05, 2011 3:39 pm
Creating a file list, excluding folders
I'm trying to create a file listing in a large directory, excluding a list of subfolders.I've got it working using nested loops to compare every file to every excluded folder, but it's incredibly inefficient and is taking an hour to run.Does anyone have any better ideas?
Creating a file list, excluding folders
Give me example of necessary folder and list of excluding subfolders, please.
It seems there is simple solution if excluded subfolders are in 1-st level of initial folder.
It seems there is simple solution if excluded subfolders are in 1-st level of initial folder.
Creating a file list, excluding folders
What is the simple solution to excluded subfolders are in 1-st level of initial folder?In my example I have a folder with the following structure: W: \ Customer1 \ Files \ Music W: \ Customer1 \ Files \ Documents W: \ Customer1 \ Files \ Downloads W: \ Customer1 \ Files \ CustomFolder W: \ Customer2 \ Files \ Music W: \ Customer2 \ Files \ Documents W: \ Customer2 \ Files \ Downloads W: \ Customer2 \ Files \ CustomFolderetc.... I want to creat list of all files except the files from the folder "Music" and "Documents". In fact there are over 500 Customers and each folder "Files" contains 50 subfolders from which I exclude the 30!! Have you any idea?
Creating a file list, excluding folders
Algorithm is a bit complicated, but this can be solved
See this example, please
this task works with structure:
C:\ incoming\customers\ customer1\files\ CustomFolder
C:\ incoming\customers\ customer1\files\ Documents
C:\ incoming\customers\ customer1\files\ Downloads
C:\ incoming\customers\ customer1\files\ Music
C:\ incoming\customers\ customer2\files\ CustomFolder
C:\ incoming\customers\ customer2\files\ Documents
C:\ incoming\customers\ customer2\files\ Downloads
C:\ incoming\customers\ customer2\files\ Music
etc...
You can specify your own start folder
The task selects all files from folder
customerN\files
without subfolders Music and Documents
You can specify your own list of folders too.
See this example, please
this task works with structure:
C:\ incoming\customers\ customer1\files\ CustomFolder
C:\ incoming\customers\ customer1\files\ Documents
C:\ incoming\customers\ customer1\files\ Downloads
C:\ incoming\customers\ customer1\files\ Music
C:\ incoming\customers\ customer2\files\ CustomFolder
C:\ incoming\customers\ customer2\files\ Documents
C:\ incoming\customers\ customer2\files\ Downloads
C:\ incoming\customers\ customer2\files\ Music
etc...
You can specify your own start folder
The task selects all files from folder
customerN\files
without subfolders Music and Documents
You can specify your own list of folders too.
Last edited by Oleg on Mon Feb 06, 2012 12:23 pm, edited 1 time in total.
Creating a file list, excluding folders
Normal
0
false
false
false
EL
X-NONE
X-NONE
MicrosoftInternetExplorer4
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Êáíïíéêüò ðßíáêáò";
mso-tstyle-rowband-size:0;
mso-tstyle-colband- size:0;
mso-style-noshow:yes;
mso-style-priority:99;
m so-style-qformat:yes;
mso-style-parent:"";
mso-padding-a lt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0c m;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0 cm;
line-height:115%;
mso-pagination:widow-orphan;
fon t-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-a scii-font-family:Calibri;
mso-ascii-theme-font:minor-latin ;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi- font-family:Calibri;
mso-hansi-theme-font:minor-latin;}
Thanks
for the
help.
With the above task (making some changes) was able to delete 85.000
files, about 142GB!