473,656 Members | 2,921 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I get a list of all filenames into one text file?

ok,
batch files will be written out at a certain time into one directory...i
need all of the filenames from one directory to be listed in one text
file...how can i do that??
thanks,
Trint

..Net programmer
tr********@hotm ail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #1
2 2449
You can use the System.Io.Direc toryInfo to get a list of files, then use a
filestream object to write out each one of their names.
"Trint Smith" <tr********@hot mail.com> wrote in message
news:ez******** ******@TK2MSFTN GP12.phx.gbl...
ok,
batch files will be written out at a certain time into one directory...i
need all of the filenames from one directory to be listed in one text
file...how can i do that??
thanks,
Trint

Net programmer
tr********@hotm ail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #2
Hello,

"Trint Smith" <tr********@hot mail.com> schrieb:
batch files will be written out at a certain time into one directory...i
need all of the filenames from one directory to be listed in one text
file...how can i do that??


System.IO.Direc toryInfo.GetFil es

will return an array of strings containing the file names of the files in
the directory. Have a look at the classes FileStream and StreamWriter in
the System.IO namespace for writing the data to a file.

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
1397
by: jamesthiele.usenet | last post by:
I wrote this little piece of code to get a list of relative paths of all files in or below the current directory (*NIX): walkList = , x) for x in os.walk(".")] filenames = for dir, files in walkList: filenames.extend() for f in files]) It works fine, I don't need to change it, but I know there is a one liner list/generator comprehension to do this - I'm just not well
4
2893
by: Ben Rf | last post by:
Hi I'm new to programming and i'd like to write a program that will parse a list produced by md5summer and give me a report in a text file on which md5 sums appear more than once and where they are located. the end end goal is to have a way of finding duplicate files that are scattered across a lan of 4 windows computers. I've dabbled with different languages over the years and i think
4
1771
by: Mullin Yu | last post by:
e.g. c:\test doc1.txt doc1.pdf doc2.txt doc2.pdf doc3.txt doc4.pdf doc5.txt doc5.pdf
10
1249
by: Abubakar | last post by:
Hi all, I'm using stl's list to store some file names. Its declared as: list < char * filenames; i enumerate the list by using: list < char * >::const_iterator filename; filename = filenames.begin();
4
2110
by: thoseion | last post by:
Hi, I am trying to get a program working whereby directory and file names are read into a list. I have been given the original list structure - it appears that the directory names should be added to the list, then the filenames added to another separate but connected list within each directory node. So far I have the program working in that the directory and file names are all added to the list, i.e. it currently doesn't distinguish...
2
5379
by: Taras_96 | last post by:
Hi everyone, Firstly, I would like to know if you can open chinese filenames under win2000 using PHP 5.0? I have a file named 中国.php, and try to open it using fopen(‘中国.php','r');. I save the source file as UTF-8. I get the error: Warning: fopen(中国.php) : failed to open stream: No such file or directory in E:\Translation\Website
6
1589
by: eso40043 | last post by:
Hello, I am a newbie at python, as will shortly become painfully apparent. I wrote some code that goes through a list of file names that contain names of stars. I put the star names in 'tgtnamelist'. The corresponding file names are in 'imagelist'. 'imagelist' and 'tgtnamelist' have the same length. 'tgtnamelist' does not contain len(tgtnamelist) different star names, so I want to group all the filenames that correspond to a unique star name...
0
2501
by: chongming | last post by:
Hi, i want to display all the filenames on browser. However i found that if there are many filenames in that folder, result will be it will display a long list of filenames on that browser. My question is how do i iterate the file names with 5 filenames on each page? I have manage to retrieve and display the filenames with the codes below. Can anyone help me or give advice on how to do the iteration? The codes are below and able to...
6
3150
by: kimiraikkonen | last post by:
Hello, I have a listbox and folder browser control. I need to display all .mp3 files' pathes into listbox. It was Ok with openfiledialog but how can list all .mp3 extension- having files into my listbox using folder browser control. A sample code would be great.
0
8296
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8710
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8598
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2721
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1598
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.