Click here to Skip to main content
15,886,689 members
Home / Discussions / C#
   

C#

 
GeneralRe: Split text file by Fixed Length Pin
musefan29-Apr-09 22:46
musefan29-Apr-09 22:46 
GeneralRe: Split text file by Fixed Length Pin
yueru29-Apr-09 23:16
yueru29-Apr-09 23:16 
GeneralRe: Split text file by Fixed Length Pin
musefan29-Apr-09 23:28
musefan29-Apr-09 23:28 
GeneralRe: Split text file by Fixed Length Pin
yueru29-Apr-09 23:41
yueru29-Apr-09 23:41 
GeneralRe: Split text file by Fixed Length Pin
musefan29-Apr-09 23:56
musefan29-Apr-09 23:56 
GeneralRe: Split text file by Fixed Length [modified] Pin
yueru30-Apr-09 0:09
yueru30-Apr-09 0:09 
GeneralRe: Split text file by Fixed Length Pin
musefan30-Apr-09 0:36
musefan30-Apr-09 0:36 
GeneralRe: Split text file by Fixed Length Pin
OriginalGriff30-Apr-09 1:33
mveOriginalGriff30-Apr-09 1:33 
If you look closely at the code segement you posted:

yueru wrote:

string line = reader.ReadLine();
   while (line != null)
   {
      string newLine = line.Replace("=", " ");
      string[] vals = newLine.Split(' ');
      line = reader.ReadLine();
   }
//I add this
   textBox4.Text = reader.ReadLine();
   reader.Close();


The problem becomes obvious, no?

When does it exit from the while loop?

How much of the file is left to be read into textBox4?

If you still can't see it, run it slowly through the debugger (sorry Luc) and it should be crystal clear.

Before you ask, no I won't correct your code. This is a basic error and you will learn better finding it yourself - you have all the clues and tools you need.

No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

AnswerRe: Split text file by Fixed Length Pin
N a v a n e e t h29-Apr-09 21:58
N a v a n e e t h29-Apr-09 21:58 
QuestionRe: Split text file by Fixed Length Pin
yueru29-Apr-09 22:06
yueru29-Apr-09 22:06 
AnswerRe: Split text file by Fixed Length Pin
yueru5-May-09 21:23
yueru5-May-09 21:23 
AnswerRe: Split text file by Fixed Length Pin
Mycroft Holmes29-Apr-09 21:59
professionalMycroft Holmes29-Apr-09 21:59 
AnswerRe: Split text file by Fixed Length Pin
Vasudevan Deepak Kumar29-Apr-09 22:33
Vasudevan Deepak Kumar29-Apr-09 22:33 
GeneralRe: Split text file by Fixed Length Pin
yueru29-Apr-09 23:24
yueru29-Apr-09 23:24 
AnswerRe: Split text file by Fixed Length Pin
Mbah Dhaim30-Apr-09 3:01
Mbah Dhaim30-Apr-09 3:01 
QuestionQuestion on Web serivce... Pin
Siva Koyi29-Apr-09 21:23
Siva Koyi29-Apr-09 21:23 
AnswerRe: Question on Web serivce... Pin
N a v a n e e t h29-Apr-09 21:56
N a v a n e e t h29-Apr-09 21:56 
GeneralRe: Question on Web serivce... Pin
Siva Koyi29-Apr-09 22:11
Siva Koyi29-Apr-09 22:11 
GeneralRe: Question on Web serivce... Pin
N a v a n e e t h29-Apr-09 23:07
N a v a n e e t h29-Apr-09 23:07 
GeneralRe: Question on Web serivce... Pin
Jabbar_espania30-Apr-09 1:33
Jabbar_espania30-Apr-09 1:33 
AnswerRe: Question on Web serivce... Pin
saanj29-Apr-09 23:47
saanj29-Apr-09 23:47 
Questionthread cpu usage Pin
shefa' isied29-Apr-09 21:07
shefa' isied29-Apr-09 21:07 
AnswerRe: thread cpu usage Pin
Jack Li29-Apr-09 21:21
Jack Li29-Apr-09 21:21 
AnswerRe: thread cpu usage Pin
N a v a n e e t h29-Apr-09 21:52
N a v a n e e t h29-Apr-09 21:52 
QuestionICollectionView Pin
Paw Jershauge29-Apr-09 20:29
Paw Jershauge29-Apr-09 20:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.