What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Need a program to scan and save all names of files in a certain folder

Need a program to scan and save all names of files in a certain folder
Author: Message:
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
32 / Male / Flag
Joined: Jul 2006
O.P. Need a program to scan and save all names of files in a certain folder
I am looking for a program that scans through a certain folder, and saves all of the files names (without file extension) into a text document? anyone know of anything like this?
09-15-2007 10:06 PM
Profile E-Mail PM Find Quote Report
ddunk
Veteran Member
*****

Avatar

Posts: 1228
Reputation: 51
35 / Male / Flag
Joined: Mar 2004
RE: Need a program to scan and save all names of files in a certain folder
Winkey + R
cmd
cd <folder>
dir /b > C:\Output.txt

Includes file extentions, but those are simple enough to remove

This post was edited on 09-15-2007 at 10:18 PM by ddunk.
09-15-2007 10:17 PM
Profile E-Mail PM Web Find Quote Report
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
32 / Male / Flag
Joined: Jul 2006
O.P. RE: Need a program to scan and save all names of files in a certain folder
quote:
Originally posted by ddunk
Winkey + R
cmd
cd <folder>
dir /b > C:\Output.txt

Includes file extentions, but those are simple enough to remove
Any way to do it without file extensions because i want to do this for like 300 files

EDIT: and when i try and do that, i get: access is denied, even though i am the only admin on this computer

This post was edited on 09-16-2007 at 02:38 PM by Jimbo.
09-16-2007 02:34 PM
Profile E-Mail PM Find Quote Report
Mike
Elite Member
*****

Avatar
Meet the Spam Family!

Posts: 2795
Reputation: 48
32 / Male / Flag
Joined: Mar 2003
RE: Need a program to scan and save all names of files in a certain folder
If you are using vista, save to the C:\Users\YourUserName location or run cmd as an administrator.
YouTube closed-captions ripper (also allows you to download videos!)
09-16-2007 05:01 PM
Profile E-Mail PM Web Find Quote Report
Verte
Full Member
***

Avatar

Posts: 272
Reputation: 7
Joined: Apr 2007
RE: RE: Need a program to scan and save all names of files in a certain folder
quote:
Originally posted by Jimbodude
Any way to do it without file extensions because i want to do this for like 300 files


There is probably an easier way using some kind of posix features, but I'm not that smart. So, here's some Python.

import os
output = open("output.txt",'a')
filenames = os.listdir("C:\\directory\\you\\want\\to\\list\\")
for file in filenames:
    output.write(file.split(".")[0] + "\r\n")
output.close()

just a first order approximation of course, I mean, this is not going to be that grand for files with more than one period in them. But, it will do for a measly 300 files.
was put impeccably into words at DebianDay for me last Saturday, by Knut Yrvin of Trolltech - adults try something once, fail, and then are like "ffs this doesn't work". Children try, fail, and then try again, and succeed - maybe on the second, or even fifth retry. But the thing is that they keep at it and overcome the problems in the end.

-andrewdodd13
09-16-2007 05:55 PM
Profile E-Mail PM Find Quote Report
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
32 / Male / Flag
Joined: Jul 2006
O.P. RE: Need a program to scan and save all names of files in a certain folder
Thanks guys, also, once ive removed the extensions, i get some duplicate files, anyone know whow to automatically delete these duplicates??
EDIT: cant see to get that python code to work, so any other ways od doing it?
Or if anyone feels up to it, they can edit the attachment and delete the file extenions and duplicates

.txt File Attachment: Output.txt (17.69 KB)
This file has been downloaded 1016 time(s).

This post was edited on 09-16-2007 at 07:06 PM by Jimbo.
09-16-2007 06:57 PM
Profile E-Mail PM Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: Need a program to scan and save all names of files in a certain folder
Here, file extensions and duplicates removed. :p

Note: Some of the files had more than one extension, but I only removed the last one.

.txt File Attachment: Output_2.txt (6.93 KB)
This file has been downloaded 253 time(s).

This post was edited on 09-16-2007 at 11:17 PM by WDZ.
09-16-2007 11:16 PM
Profile PM Web Find Quote Report
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
32 / Male / Flag
Joined: Jul 2006
O.P. RE: Need a program to scan and save all names of files in a certain folder
Yay thanks WDZ :)
09-17-2007 06:02 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On