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:
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
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Need a program to scan and save all names of files in a certain folder - by Jimbo on 09-15-2007 at 10:06 PM
RE: Need a program to scan and save all names of files in a certain folder - by ddunk on 09-15-2007 at 10:17 PM
RE: Need a program to scan and save all names of files in a certain folder - by Jimbo on 09-16-2007 at 02:34 PM
RE: RE: Need a program to scan and save all names of files in a certain folder - by Verte on 09-16-2007 at 05:55 PM
RE: Need a program to scan and save all names of files in a certain folder - by Mike on 09-16-2007 at 05:01 PM
RE: Need a program to scan and save all names of files in a certain folder - by Jimbo on 09-16-2007 at 06:57 PM
RE: Need a program to scan and save all names of files in a certain folder - by WDZ on 09-16-2007 at 11:16 PM
RE: Need a program to scan and save all names of files in a certain folder - by Jimbo on 09-17-2007 at 06:02 AM


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