Results 1 to 4 of 4

Thread: [RESOLVED] Read Text File Charcter by Character.

  1. #1

    Thread Starter
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4800 x12
    Posts
    1,333

    Resolved [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:
    1. Do Until EOF(ff)
    2.         x = x + 1
    3.         Str = Input(x, ff)
    4.         Str = Right(Str, 1)
    5.         Debug.Print Str
    6.    
    7.     Loop

    Needless to say it doesn't work...

    Can anyone show me how i would go about doing this ?
    Zeegnahtuer?

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Read Text File Charcter by Character.

    VB Code:
    1. Dim tmp As String
    2. Open "C:\CSO.txt" For Input As #1
    3.  tmp = Input(LOF(1), 1)
    4. Close #1
    5.  
    6. For x = 1 To Len(tmp)
    7.     LetteR = Mid(tmp, x, 1)
    8.     'do something with Letter
    9. Next
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4800 x12
    Posts
    1,333

    Re: Read Text File Charcter by Character.

    Wow, you've been helpful today.

    Cheers.
    Zeegnahtuer?

  4. #4

    Thread Starter
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4800 x12
    Posts
    1,333

    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.
    Zeegnahtuer?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width