从文件读取到2d数组 [英] Reading from a file into a 2d array

查看:79
本文介绍了从文件读取到2d数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


Hi,


我一直试图解决这个问题一段时间但是无论我尝试什么,它似乎不起作用。 

I been trying to solve this problem for a while now but no matter what I try, it doesn't seem to work. 


所以,我有一个文件包含用户信息,如密码和用户名,我已经做到了这样,用户可以输入名称和密码,并将其保存到文本文件中,例如 

So, I have a file that contains user-info like password and usernames and I have made it so that user can input a name and password and have it save to a text file e.g. 


密码= Pass123

Password = Pass123


Name = Henry

Name = Henry


file in Henry = Henry,Pass123

Data in file = Henry,Pass123


现在,当越来越多的数据添加到文件中时,我希望能够通过将数据转换为二维数组来获得用户的密码。所以名称将是collum one和password collum 2

Now, when more and more data is added to the file, i want to be able to get just the passwords of the users by getting the data into a 2d array. So Name would be collum one and password collum 2


有关如何操作的任何建议吗?

Any suggestions of how to do this?

推荐答案





这篇关于从文件读取到2d数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆