473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

HELP ! Populate text file from array

I have a text file being created and need the values from the array that
gets created to populate my text file. I am new and not very good. Kinda
borrowing bits and pieces from here and there, so if my code is a mess
(Which it is ) don't be alarmed.
Myfile is the array that gets populated and I need it's results returned
to the text file .

Below is the code...

Dim oFile As System.IO.File

Dim oWrite As System.IO.StreamWriter

Dim folderpath As String ' Path to users folders.

Dim dirpath, adir, sdir, testpath, myfile

Me.txt1.Text = "Starting search now."

Me.Button2.Text = "Running!"

oWrite = oFile.CreateText("C:\sample.txt") ' Creates the file to write
results to.

dirpath = "J:\" ' Sets the root Directory.
adir = Directory.GetDirectories(dirpath) 'Get the Directories under the root
of "Dirpath"

Try

For Each folderpath In adir

sdir = Path.GetFileName(folderpath) & "\Cookies" 'Sets the folder to look in
the cookies folder.

TESTPATH = (dirpath & sdir)

Me.txt1.Text = (sdir)

myfile = Directory.GetFiles(TESTPATH)

Debug.WriteLine(myfile)

oWrite.WriteLine(sdir, myfile)

Next

oWrite.Close()

MsgBox("Im done")

Catch ex As Exception

MessageBox.Show("ERROR: " & ex.ToString())

End Try

Me.Button2.Text = "Start!"
Nov 21 '05 #1
1 1387
Try taking a look at this...perhaps this will help you out...

http://www.microsoft.com/technet/scr.../mstxvb10.mspx
Nov 21 '05 #2

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

Similar topics

11
by: alex | last post by:
Hi, I am looking for a way to populate an HTML table from an external local text file which looks like this: DATE/TIME LAT. LON. DEPTH. ML....
1
by: Marcelo | last post by:
Hi, I have to do the following, and would like you suggestions on how I could achieve it the best way: I have a text file in the following format: 12345 54321 98765 56789 (3 spaces...
1
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
0
by: vijendra | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file?I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
5
by: CCLeasing | last post by:
Hello, I have searched google but can not find a straight forward answer to my problem. Hopefuly someone will be kind enough to offer their expertise. Please forgive if this seems a bit convoluted...
0
by: CCLeasing | last post by:
Hello, I have searched google but can not find a straight forward answer to my problem. Hopefuly someone will be kind enough to offer their expertise. Please forgive if this seems a bit convoluted...
4
by: | last post by:
Hi all, I want to create a method that does the following: 1) Programmatically instantiate a new XmlDataSource control 2) For each file in a named directory, make a "FileSystemItem" element 3)...
0
by: WillG | last post by:
Hi, I have spent most of the afternoon looking for what is probably a really simple solution. I am trying to add a checkbox to a form but I can't figure out how to do it. I basically want to add a...
4
by: Paul David Buchan | last post by:
Hello, I'm attempting to write a program to read in database files (.dbf). When I do it all as a single procedure in main, everything works. However, what I really want, is to pass the database...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.