我有一个文本文件,看起来像下面的格式。我正尝试创建一个格式不正确的数据表。我已经尝试了一些不同的东西,以正确格式化它但是我有的ReadLine问题vb.net textfile ReadLine循环
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 ...我们不能将它作为一个dup关闭。 – LarsTech
它不同,因为我加入了1.1.1.1。一旦程序读取1.1.1.1我怎样才能把它交给我的第一个循环。从不回答 – codeMonger123