问题描述
嘿!
我需要帮助来了解如何编写代码以解析.txt文件中的数据(如下)并将其存储为变量
83岁的小金(Kim)
76岁的杰克(Jake),
98岁的艾琳(Erin)
69岁的罗纳德(Ronald)
83岁的吉姆(Freshman)
凯特(91岁大二)
史蒂夫,64岁,新鲜人
89岁的朱莉(Julie)
75岁的Mark,高级
保罗,81岁,高级
56岁的麦克(Freshman)
97岁的梅根,少年
杰森,67岁,大二
玲88岁的老人
70岁的萝莉(Lori)
我相信我必须使用其中一些代码吗?
Hey!
I need help understanding how to write the code to parse this data (below) from a .txt file and store them as variables
Kim,83,Junior
Jake,76,Senior
Erin,98,Senior
Ronald,69,Senior
Jim,83,Freshman
Kate,91,Sophomore
Steve,64,Freshman
Julie,89,Junior
Mark,75,Senior
Paul,81,Senior
Mike,56,Freshman
Meghan,97,Junior
Jason,67,Sophomore
Ling,88,Senior
Lori,70,Freshman
I believe that I have to use some of this code?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sr As IO.StreamReader = IO.File.OpenText("input.txt")
Dim strinput As String
但不知道还能做什么.谢谢!
[edit]添加了代码块[/edit]
but am not sure what else to do. Thank you!
[edit]code block added[/edit]
推荐答案
这篇关于来自文本文件的Visual Basic解析代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!