-
Apr 11th, 2006, 05:05 AM
#1
Thread Starter
Lively Member
[RESOLVED] Reading Text file
Hey there guys, I have some source on reading a text file, but it just reads the top line only.
so if:
john had food
today and he....
it will only read "john had food"
also I have code that can read a text file using spaces.
so if:
john had food
my text boxs would say.
1. jonh
2. had
3. food
Now what I want to do is be able to read line by line.
So if:
john had food today
john had food also yesterday
then my text boxs must look like this:
text box 1. "john had food today"
text box 2. "john has food also yesterday"
ALos i would really appritiat if you could give me the code to change the text file from VB. (Write to the text file)
Thanks alot guys... I really really hope you can help out.
-
Apr 11th, 2006, 05:09 AM
#2
Re: Reading Text file
VB Code:
Dim s As String
Open "C:\MyFile.txt" For Input As #1
Do Until EOF(1)'read entire file
Line Input #1, s 'read line in file
Loop
Close #1
-
Apr 11th, 2006, 05:12 AM
#3
Re: Reading Text file
Actually, you can find an answer to that just by doing a search here: http://www.vbforums.com/search.php?
You will see that most of the questions you will have have already been answered.
-
Apr 11th, 2006, 05:24 AM
#4
Thread Starter
Lively Member
Re: Reading Text file
Cool, thanks... I done a search and found what i was loooking for.
Thanks.,..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|