У меня есть текстовый файл, который выглядит следующим образом. Я пытаюсь создать таблицу данных из формата. Я попробовал несколько различных вещей, чтобы отформатировать его правильно, однако я имею вопрос с ReadLinevb.net textfile ReadLine Loops
Dim SectionLineONE as string
Dim NextSectionLine As String
srReader = File.OpenText(MyFile)
Dim SectionLineONE As String
Do
SectionLineONE = srReader.ReadLine()
If SectionLineONE Is Nothing Then Exit Do
If SectionLineONE.Contains("1.0") Then
Dim NextSectionLine As String
Do
NextSectionLine = srReader.ReadLine()
If NextSectionLine Is Nothing Then Exit Do
If NextSectionLine.Contains("1.1") Then
Dim NextSectionLine3 As String
Do
NextSectionLine3 = srReader.ReadLine()
If NextSectionLine Is Nothing Then Exit Do
If NextSectionLine.Contains("1.1.1") Then
Dim NextSectionLine4 As String
Do
NextSectionLine4 = srReader.ReadLine()
If NextSectionLine Is Nothing Then Exit Do
If NextSectionLine.Contains("1.1.1.1") Then
'I want the program to go to the first do loop now and check 2.0, 2.1 etc
End If
Loop
End If
Loop
End If
Loop
End If
Loop
Text File
1.0
Section 1 Title:
1.1
Section Title
1.1.1
Section Title
1.1.1.1
Section Title
Как это отличается от [вашего последнего вопроса] (http://stackoverflow.com/q/40897137/1070452) ??? – Plutonix
@Plutonix ... и мы не можем закрыть его как дуп. – LarsTech
Это другое, потому что я добавил, как я добираюсь до 1.1.1.1. Как только программа прочитает 1.1.1.1, как я могу получить ее в моем первом цикле do. Никогда не отвечал – codeMonger123