Imports System.IO Imports System.Text Imports System.Text.RegularExpressions ~ Dim rd As New StreamReader("C:\tmp\abc.txt", Encoding.UTF8) Dim reg As New Regex("(?<No>.)(?<名前>.*?) 守備(?<守備>.*?) 打率(?<打率>.*?) HR(?<HR>.*?) 打点(?<打点>.*?) 盗塁(?<盗塁>.*?)$") For Each keyvalue In DicTextBox With keyvalue.Value .名前.Text = "" .守備.Text = "" .打率.Text = "" .HR.Value = 0 .打点.Value = 0 .盗塁.Value = 0 End With Next Dim LineData = rd.ReadLine Do While LineData IsNot Nothing Dim m = reg.Match(LineData) If m.Success Then Dim No = m.Groups("No").Value Dim 名前 = m.Groups("名前").Value Dim 守備 = m.Groups("守備").Value Dim 打率 = m.Groups("打率").Value Dim HR = m.Groups("HR").Value Dim 打点 = m.Groups("打点").Value Dim 盗塁 = m.Groups("盗塁").Value Dim itm As Record = Nothing If DicTextBox.TryGetValue(No, itm) Then itm.名前.Text = 名前 itm.守備.Text = 守備 itm.打率.Text = 打率 itm.HR.Value = CInt(HR) itm.打点.Value = CInt(打点) itm.盗塁.Value = CInt(盗塁) End If End If LineData = rd.ReadLine Loop rd.Close()