|
-
Oct 27th, 2005, 10:41 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Read Text File Charcter by Character.
Hey everyone, this one has been stumping me for a while now, i need to read a text file character by character, immediately the Input Statemtn jumped to mind, and then i thought about incrememnting how much of the file i fetches and usinf the Left Command to get the next character as below -
VB Code:
Do Until EOF(ff)
x = x + 1
Str = Input(x, ff)
Str = Right(Str, 1)
Debug.Print Str
Loop
Needless to say it doesn't work...
Can anyone show me how i would go about doing this ?
-
Oct 27th, 2005, 10:45 AM
#2
Re: Read Text File Charcter by Character.
VB Code:
Dim tmp As String
Open "C:\CSO.txt" For Input As #1
tmp = Input(LOF(1), 1)
Close #1
For x = 1 To Len(tmp)
LetteR = Mid(tmp, x, 1)
'do something with Letter
Next
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Oct 27th, 2005, 10:56 AM
#3
Thread Starter
Frenzied Member
Re: Read Text File Charcter by Character.
Wow, you've been helpful today. 
Cheers.
-
Oct 27th, 2005, 10:57 AM
#4
Thread Starter
Frenzied Member
Re: [RESOLVED] Read Text File Charcter by Character.
In fact so helpful that i can actually ditch my file reading process altogether and do it straight through my program. 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
|