|
-
Oct 20th, 2009, 12:46 PM
#1
Thread Starter
New Member
RAW ASCII file reader
HI! looking for a simple example of opening and reading in a loop a raw ascii file 1 character at a time in vb.net
-
Oct 20th, 2009, 12:53 PM
#2
Re: RAW ASCII file reader
Use system.IO.streamreader class and call its Read method then convert the returned value to a char. Something like this:
Code:
Using reader As New IO.StreamReader("file path here")
Dim ch As Char
While reader.Peek >= 0
ch = Chr(reader.Read())
'Do whatever you like with this char here
End While
End Using
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Oct 20th, 2009, 12:55 PM
#3
Re: RAW ASCII file reader
Removed, stanav's example is more complete.
-
Oct 20th, 2009, 12:58 PM
#4
Thread Starter
New Member
Re: RAW ASCII file reader
i was seeing suggestions that included:
fileope() and Lineinput()
are these suggestions wrong or are they a different way of doing the same thing?
-
Oct 20th, 2009, 01:19 PM
#5
Thread Starter
New Member
Re: RAW ASCII file reader
 Originally Posted by Jenner
Removed, stanav's example is more complete. 
would you mind posting it
-
Oct 20th, 2009, 01:54 PM
#6
Re: RAW ASCII file reader
I just did the two most essential lines from his example. He's actually looping through the output. I just did:
Code:
Dim st As New IO.StreamReader("C:\MyASCIIFile.txt")
Convert.ToChar(st.Read())
As I said, his example is much more complete.
-
Oct 20th, 2009, 02:22 PM
#7
Thread Starter
New Member
Re: RAW ASCII file reader
 Originally Posted by bponce23
i was seeing suggestions that included:
fileope() and Lineinput()
are these suggestions wrong or are they a different way of doing the same thing?
anyone care to comment on these two functions with regards on how to use them for reading an raw ascii file?
-
Oct 20th, 2009, 02:41 PM
#8
Re: RAW ASCII file reader
They are VB6 legacy functions and since you're writing in .net language now, you should use .net classes/methods. On the other hand, if you just want to know what those methods do, Google it and you'll be flooded with results.
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Oct 20th, 2009, 03:00 PM
#9
Re: RAW ASCII file reader
Yea, those aren't used anymore. There are far better ways to read text files.
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
|