Delete files using a list

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
rolandd
Senior Member
Senior Member
Posts: 313
Joined: 2003-06-26, 09:02 UTC
Location: Indonesia
Contact:

Delete files using a list

Post by *rolandd »

Hello all,

Not sure if this is the first time asked but a search did not give me an answer. The scenario is very simple, I have a list of filenames in Excel and I want to delete these files from a specific directory.

I can copy this list to a text file no problem. I just can't seem to find how to use this list as input to have the files deleted.

Is there a fast way of doing this? :P

Regards,

RolandD
Registered user #92105
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

the list:

file1.txt
file2.txt

with excel, put a column before the list, and fill it with del

the result:

del file1.txt
del file2.txt

Export this to a batch file, and execute it.
I switched to Linux, bye and thanks for all the fish!
User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

Post by *XPEHOPE3KA »

You can also use cm_LoadSelectionFromClip or cm_LoadSelectionFromFile commands.
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..
rolandd
Senior Member
Senior Member
Posts: 313
Joined: 2003-06-26, 09:02 UTC
Location: Indonesia
Contact:

Post by *rolandd »

2SanskritFritz
Thanks, that does the job :)

2XPEHOPE3KA
How would I go about using those commands?

Thanks ;)
Registered user #92105
User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

Post by *XPEHOPE3KA »

2rolandd
That's easy:
1. Bind the first command to a hotkey.
2. Open your xls file (works with any text file too, of course).
3. Select needed filenames and copy the entries.
4. Goto TC and use the hotkey.
5. Files get selected, you are to press F8 or something.

The second command will work only with long names in text files.
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..
User avatar
nsp
Power Member
Power Member
Posts: 1813
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

You can use TcBatLnc http://www.geocities.com/nospam0123456/forTC

TCBLnch.exe ListFile.txt del $f

If you want to automate From a result file to a target folder inside TC :
you can use a button ::
command TCBLnch.exe
parameter -q %P\%N del "%T\$f"

if you want you can also create a cmd file like :
you can use as DelList.cmd FileList.txt FolderToDelete
------- BEG of DelList.cmd
@CHCP 1252
@FOR /F "delims=" %%i in (%1) DO del "%2\%%i"
-------- End Of DelList.cmd
Post Reply