Jump to content

Removing files based on a list


Recommended Posts

Guest still
Posted

Hi all,

 

I've got a folder with about 3000 pictures. My sister has gone through and

made a list of pictures she wants to remove in excel (instead of actually

deleting them). She now wants to get rid of the files on the list. I was

hoping there is a way of using the excel list to delete the files

automatically. One thing to note is that the file names have spaces so I'm

not sure how that will affect this.

 

Any help is greatly appreciated.

  • Replies 5
  • Created
  • Last Reply

Popular Days

Guest db.·.. >
Posted

Re: Removing files based on a list

 

actually there is,

 

however it would be simply

easier to use a program designed

to index files/folders and

manage them by with the

right click method or menu

bar options.

 

you see what you are trying to

do is to re invent the wheel.

 

the list you made in excel is

simply an index or table of

pic files and because i would

guess you don't have a year or

so to learn computer programming,

just use a freeware from

microsoft called windows

desktop search.

 

another tool that does the same

as above is the windows explorer

search assistant feature that comes

with windows already

 

the search assistant will build

an index and then you can save

that listing as a file and to the

desktop, then you can maintain that

index by adding or deleting files.

 

--

 

db·´¯`·...¸><)))º>

 

"still" <still@discussions.microsoft.com> wrote in message

news:62BB7150-72F8-42BB-8954-95C051EB9576@microsoft.com...

> Hi all,

>

> I've got a folder with about 3000 pictures. My sister has gone through and

> made a list of pictures she wants to remove in excel (instead of actually

> deleting them). She now wants to get rid of the files on the list. I was

> hoping there is a way of using the excel list to delete the files

> automatically. One thing to note is that the file names have spaces so I'm

> not sure how that will affect this.

>

> Any help is greatly appreciated.

Guest still
Posted

Re: Removing files based on a list

 

Thanks for the reply. I'm just having a bit of a problem understanding what I

need to do with windows desktop search to delete the files i have listed in

my excel file.

 

My excel file, as you said, is a list of filenames like Washington 001,

Washington 004, Washington 009, ... . Now that I have this list, I want to

load it into a program/script and let it delete them from the folder, instead

of me going and deleting them one by one and potentially make a mistake

reading from the list and deleting the wrong file.

 

I'm not sure if what I want makes complete sense. I'm not very familiar with

desktop search (although I have it installed) so I don't know how I could

tell it to use my list and delete the files on that list.

 

Once again thanks for your help.

 

"db.·.. ><))) ·>` .. ." wrote:

> actually there is,

>

> however it would be simply

> easier to use a program designed

> to index files/folders and

> manage them by with the

> right click method or menu

> bar options.

>

> you see what you are trying to

> do is to re invent the wheel.

>

> the list you made in excel is

> simply an index or table of

> pic files and because i would

> guess you don't have a year or

> so to learn computer programming,

> just use a freeware from

> microsoft called windows

> desktop search.

>

> another tool that does the same

> as above is the windows explorer

> search assistant feature that comes

> with windows already

>

> the search assistant will build

> an index and then you can save

> that listing as a file and to the

> desktop, then you can maintain that

> index by adding or deleting files.

>

> --

>

> db·´¯`·...¸><)))º>

>

> "still" <still@discussions.microsoft.com> wrote in message

> news:62BB7150-72F8-42BB-8954-95C051EB9576@microsoft.com...

> > Hi all,

> >

> > I've got a folder with about 3000 pictures. My sister has gone through and

> > made a list of pictures she wants to remove in excel (instead of actually

> > deleting them). She now wants to get rid of the files on the list. I was

> > hoping there is a way of using the excel list to delete the files

> > automatically. One thing to note is that the file names have spaces so I'm

> > not sure how that will affect this.

> >

> > Any help is greatly appreciated.

>

>

Guest Tim Slattery
Posted

Re: Removing files based on a list

 

still <still@discussions.microsoft.com> wrote:

>Hi all,

>

>I've got a folder with about 3000 pictures. My sister has gone through and

>made a list of pictures she wants to remove in excel (instead of actually

>deleting them). She now wants to get rid of the files on the list. I was

>hoping there is a way of using the excel list to delete the files

>automatically. One thing to note is that the file names have spaces so I'm

>not sure how that will affect this.

 

Hmm..I'd save the spreadsheet as a text file. Then open it in a text

editor and add

 

delete "

 

at the beginning of each line, and

 

"

 

at the end. Then save it as something.bat or something.cmd, preferably

in the directory where the images are (will make it easier to invoke).

Now open a command window, navigate to the directory in question and

invoke it:

 

something.cmd

 

--

Tim Slattery

MS MVP(Shell/User)

Slattery_T@bls.gov

http://members.cox.net/slatteryt

Guest still
Posted

Re: Removing files based on a list

 

Thanks Tim, great solution. I can do this easily in excel just write a

formula with 'delete "' in front. Thanks again.

 

"Tim Slattery" wrote:

> still <still@discussions.microsoft.com> wrote:

>

> >Hi all,

> >

> >I've got a folder with about 3000 pictures. My sister has gone through and

> >made a list of pictures she wants to remove in excel (instead of actually

> >deleting them). She now wants to get rid of the files on the list. I was

> >hoping there is a way of using the excel list to delete the files

> >automatically. One thing to note is that the file names have spaces so I'm

> >not sure how that will affect this.

>

> Hmm..I'd save the spreadsheet as a text file. Then open it in a text

> editor and add

>

> delete "

>

> at the beginning of each line, and

>

> "

>

> at the end. Then save it as something.bat or something.cmd, preferably

> in the directory where the images are (will make it easier to invoke).

> Now open a command window, navigate to the directory in question and

> invoke it:

>

> something.cmd

>

> --

> Tim Slattery

> MS MVP(Shell/User)

> Slattery_T@bls.gov

> http://members.cox.net/slatteryt

>

Guest John John (MVP)
Posted

Re: Removing files based on a list

 

Export the Excel filelist to a text file then run a batch command

against the fileset:

 

for /f "usebackq delims=" %%A in ("c:\dirlist.txt") do echo "%%A"

 

The above will echo the filelist, to delete the files replace echo in

the above command with del . Note that files deleted at the command

prompt or with batch files do not go to the Recycle Bin, they are

permanently deleted! It may be safer to MOVE the files then examine the

results and delete the file from their new location:

 

md c:\test

for /f "usebackq delims=" %%A in ("c:\dirlist.txt") do move "%%A" C:\Test

 

or make sure you have a backup before you run the batch file!

 

If the filelist only contains names (filename.jpg) as opposed to fully

qualified filenames and path, (C:\Folder Name\filename.jpg) put the

filename.txt file and the batch file in the same folder as the pictures

and from a command prompt navigate to the folder and launch the batch

file from within the containing folder. The batcg commmand will look

for the files in the folder where it was launched.

 

John

 

still wrote:

> Hi all,

>

> I've got a folder with about 3000 pictures. My sister has gone through and

> made a list of pictures she wants to remove in excel (instead of actually

> deleting them). She now wants to get rid of the files on the list. I was

> hoping there is a way of using the excel list to delete the files

> automatically. One thing to note is that the file names have spaces so I'm

> not sure how that will affect this.

>

> Any help is greatly appreciated.


×
×
  • Create New...