Need some help
-
I'm in need of a quick answer to a problem. I am trying to parse a tab delimited file for the purpose of feed it to a check printer. I am using a stream reader and the issue is that the reader is dropping the first char of each line. Here's the code: Do While strRead.Read <> strRead.EndOfStream strTest = strRead.ReadLine strWrite = strTest.Replace("""", "") ListBox1.Items.Add(strWrite) Loop Can anybody help? Thanks:confused:
-
I'm in need of a quick answer to a problem. I am trying to parse a tab delimited file for the purpose of feed it to a check printer. I am using a stream reader and the issue is that the reader is dropping the first char of each line. Here's the code: Do While strRead.Read <> strRead.EndOfStream strTest = strRead.ReadLine strWrite = strTest.Replace("""", "") ListBox1.Items.Add(strWrite) Loop Can anybody help? Thanks:confused:
ok I found a solution this method from the MSDN worked. I'm not sure why at this point. When I figure it out I'll let you know. Using sr As StreamReader = New StreamReader("TestFile.txt") Dim line As String Do line = sr.ReadLine() Console.WriteLine(Line) Loop Until line Is Nothing sr.Close() End Using
-
I'm in need of a quick answer to a problem. I am trying to parse a tab delimited file for the purpose of feed it to a check printer. I am using a stream reader and the issue is that the reader is dropping the first char of each line. Here's the code: Do While strRead.Read <> strRead.EndOfStream strTest = strRead.ReadLine strWrite = strTest.Replace("""", "") ListBox1.Items.Add(strWrite) Loop Can anybody help? Thanks:confused:
Hi, I would guess strRead.Read really reads something, maybe one byte or so, and you don't process it. Did you care looking at the documentation of the classes you use? :)
Luc Pattyn [Forum Guidelines] [My Articles]
Voting for dummies? No thanks. X|
-
I'm in need of a quick answer to a problem. I am trying to parse a tab delimited file for the purpose of feed it to a check printer. I am using a stream reader and the issue is that the reader is dropping the first char of each line. Here's the code: Do While strRead.Read <> strRead.EndOfStream strTest = strRead.ReadLine strWrite = strTest.Replace("""", "") ListBox1.Items.Add(strWrite) Loop Can anybody help? Thanks:confused:
strRead.Read reads the first character of every line. do while not str.Read.EndOfStream ... loop
Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my homepage Oracle Studios Discounted or Free Software for Students: DreamSpark - downloads.channel8.msdn.com MSDN Academic Alliance - www.msdnaa.com
-
Hi, I would guess strRead.Read really reads something, maybe one byte or so, and you don't process it. Did you care looking at the documentation of the classes you use? :)
Luc Pattyn [Forum Guidelines] [My Articles]
Voting for dummies? No thanks. X|
-
Hi, I would guess strRead.Read really reads something, maybe one byte or so, and you don't process it. Did you care looking at the documentation of the classes you use? :)
Luc Pattyn [Forum Guidelines] [My Articles]
Voting for dummies? No thanks. X|
Luc Pattyn wrote:
Did you care looking at the documentation of the classes you use?
He obviously didn't and can't believe the attitude he gave you in his reply about reading documentation.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
Come on now read documentation? Who does that? No your right under the pressure of an angry ap clerk I did not research class well. Since I have been doing this since vb3 you'd think I'd know beter by now. :-O
jhoga wrote:
Come on now read documentation? Who does that?
Real people.
jhoga wrote:
the pressure of an angry ap clerk
Well, let's see the angry ap clerk do a better job, which I doubt :-\
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
Luc Pattyn wrote:
Did you care looking at the documentation of the classes you use?
He obviously didn't and can't believe the attitude he gave you in his reply about reading documentation.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
Paul Conrad wrote:
He obviously didn't and can't believe the attitude he gave you in his reply about reading documentation.
Did you get that he was poking fun at himself in his reply? Did you see the "Red face" emoticon? He wasn't giving any attitude. He was saying "Doh!".
-
Paul Conrad wrote:
He obviously didn't and can't believe the attitude he gave you in his reply about reading documentation.
Did you get that he was poking fun at himself in his reply? Did you see the "Red face" emoticon? He wasn't giving any attitude. He was saying "Doh!".
RCoate wrote:
Did you get that he was poking fun at himself in his reply?
Looking back at it, yes.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon