Sub populateList
If File.Exists(File.DirRootExternal,"all.txt") Then
Dim Reader1 As TextReader
If Reader1.IsInitialized = False Then
Reader1.Initialize(File.OpenInput(File.DirRootExternal,"all.txt"))
End If
End If
Dim list2 As List
list2.Initialize
Dim LN As Int
Dim line As String
line=Reader1.ReadLine
Do While line <> Null
line = line.Replace(",", " ") ' replace , in the crew name
list2.Add(line)
listview1.AddSingleLine(line)
line=Reader1.ReadLine
Loop
Reader1.Close
LN = listview1.Size
'list2.RemoveAt(LN-1)
list2.RemoveAt(LN-2) ' remove the last line with<p>
list2.RemoveAt(0) ' remove the 1st few empty lines and <p>
list2.RemoveAt(0)
list2.RemoveAt(0)
File.WriteList(File.DirRootExternal, "alltxtdata.txt", list2)
list2.IsInitialized
Dim list1 As List
list1.Initialize
If File.Exists(File.DirRootExternal,"alltxtdata.txt")=True Then
Dim Reader2 As TextReader
If Reader2.IsInitialized = False Then
Reader2.Initialize(File.OpenInput(File.DirRootExternal,"alltxtdata.txt"))
End If
'Dim line As String
Dim rsb As StringBuilder
line=Reader2.ReadLine
Do While line.Length >0
rsb.Initialize
rsb.Append(line)
rsb.Insert(9,",")
rsb.Insert(33,",")
rsb.Insert(37,",")
rsb.Insert(42,",")
rsb.Insert(48,",")
rsb.Insert(58,",")
rsb.Insert(64,",")
rsb.Insert(75,",")
rsb.Insert(85,",")
DoEvents
Dim CC() As String 'CC is parsed elements content
Dim Line2 As String
Line2=rsb.ToString
CC = Regex.Split(",", Line2) 'field separator is comma
Line2=CC(0).Trim & "," & CC(1).Trim & "," & CC(2).Trim & "," & CC(3).Trim & "," & CC(4).Trim & "," & _
CC(5).Trim & "," & CC(6).Trim & "," & CC(7).Trim & "," & CC(8).Trim & "," & CC(9).Trim
list1.Add(Line2)
tempListView.AddSingleLine (Line2)
line=Reader2.ReadLine
Loop
Reader2.Close
ProgressDialogHide
File.WriteList(File.DirRootExternal, "allListgd.txt", list1)
' Msgbox("Ready for Part 2 conversion", " PART 1 COMPLETED")
Else
Msgbox("file does not exist","error")
End If
button3.Visible = True
End Sub