title: (VB.NET) display the lower half of a textfile to a listbox
body: <p>I have to make a application that organizes a list of runners and their teams. In the following text file, I have to remove the top half of the text file (the top half being the listed teams) and display only the bottom half (the runners)in a listbox item. </p>
  
  <p><strong>The Text file:</strong></p>
  
  <pre><code> # School [School Code|School Name|Coach F-Name|Coach L-Name|AD F-Name|AD L Name]
   WSHS|Worcester South High School|Glenn|Clauss|Bret|Zane
   WDHS|Worcester Dorehty High School|Ellsworth|Quackenbush|Bert|Coco
   WBCHS|Worcester Burncoat High School|Gail|Cain|Kevin|Kane
   QRHS|Quabbin Regional High School|Bob|Desilets|Seth|Desilets  
   GHS|Gardner High School|Jack|Smith|George|Fanning   
   NBHS|North Brookfield High School|Hughe|Fitch|Richard|Carey
   WHS|Winchendon High School|Bill|Nice|Sam|Adams
   AUBHS|Auburn High School|Katie|Right|Alice|Wonderland
   OXHS|Oxford High School|Mary|Cousin|Frank|Daughter
   # Roster [Bib #|School Code|Runner's F-Name|Runner's L-Name]
   101|WSHS|Sanora|Hibshman
   102|WSHS|Bridgette|Moffitt
   103|WSHS|Karine|Chunn
   104|WSHS|Shanita|Wind
   105|WSHS|Fernanda|Parsell
   106|WSHS|Albertha|Baringer
   107|WSHS|Carlee|Sowards
   108|WDHS|Maisha|Kleis
   109|WDHS|Lezlie|Berson
   110|WDHS|Deane|Rocheleau
   111|WDHS|Hang|Hodapp
   112|WDHS|Zola|Dorrough
   113|WDHS|Shalon|Mcmonigle
  </code></pre>
  
  <p>I have some code that reads each row from the text file as an array and uses boolean variables to determine where to end the text file. This worked with displaying only the teams, which I've managed to do. But I now need to do the opposite and display only the players, and I'm a bit stumped. </p>
  
  <p><strong>My Code:</strong> </p>
  
  <pre><code>   Private Sub btnLoadTeams_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoadTeam.Click
      ' This routine loads the lstTeam box from an ASCII .txt file
      ' # School [School Code | Name | Coach F-Name| Coach L-Name | AD F-Name | AD L-Name]
  
      Dim strRow As String
      Dim bolFoundCode As Boolean = False
      Dim bolEndCode As Boolean = False
      Dim bolFoundDup As Boolean = False
      Dim intPosition As Integer
      Dim intPosition2 As Integer
      Dim strTeamCodeIn As String
      Dim textIn As New StreamReader( _
          New FileStream(txtFilePath.Text, FileMode.OpenOrCreate, FileAccess.Read))
      ' Clear Team listbox
      lstTeam.Items.Clear()
      btnDeleteRunner.Enabled = True
  
      Do While textIn.Peek &lt;&gt; -1 And Not bolEndCode
          Me.Refresh()
          strRow = textIn.ReadLine.Trim
          If Not bolFoundCode Then
              If "# SCHOOL " = UCase(Mid(strRow, 1, 9)) Then
                  bolFoundCode = True
              End If
          Else
              If Mid(strRow, 1, 2) &lt;&gt; "# " Then
                  For Each item As String In lstTeam.Items
                      intPosition = InStr(1, strRow, "|")
                      strTeamCodeIn = Mid(strRow, 1, intPosition - 1)
                      intPosition2 = InStr(1, item, strTeamCodeIn)
  
                      If intPosition2 &gt; 0 Then
                          bolFoundDup = True
                          MsgBox("Found Duplicate School Code: " &amp; strTeamCodeIn)
  
                      End If
             Else
                 bolEndCode = True
                  Next
  
                  If Not bolFoundDup Then
                      lstTeam.Items.Add(strRow)
  
                  Else
                      lstTeam.Items.Add("DUPLICATE School Code: " &amp; strRow)
                      lstTeam.Items.Add("Please correct input file and reload teams")
                      bolEndCode = True
                  End If
              End If
          End If
      Loop
  
  End Sub
  </code></pre>
  
  <p>Ive put bolEndCode = True in between the part that reads the mid section of the text file, but all Ive managed to display is the following in the listbox:</p>
  
  <pre><code> # Roster [Bib #|School Code|Runner's F-Name|Runner's L-Name]
  </code></pre>
  
  <p>Any help or hints on how I would display just the runners to my "lstPlayers" listbox would be greatly appreciated. I'm a beginner programmer and We've only just started learning about reading and writing arrays in my .NET class. </p>