在不使用拆分功能的情况下将CSV拆分为数组列表 [英] Split a CSV into array list without using the split function
问题描述
大家好,
有没有人听说过在不使用拆分功能的情况下将csv文件拆分成数组列表的方法。
如果我有数据:(让我们称之为数据)
1,google.com,搜索引擎
2,codeproject.com,对于那些代码
的人,我现在听说的是我可以创建一个ArrayList
ArrayList< string> newData = new ArrayList< string>(data.read());
这应该将数据拆分成不同的元素。例如newData(0)应该说1
希望这是有道理的。
非常感谢
Hello all,
Has anyone heard of a way to split a csv file into an array list without using the split function.
If I had the data: (lets call it data)
"1",google.com,"Search engine"
"2",codeproject.com,"For those that code"
now what ive heard is that I can create an ArrayList
ArrayList<string> newData = new ArrayList<string>(data.read());
This should then split the data up into different elements. e.g newData(0) should say "1"
Hopefully that makes some sense.
Many thanks
推荐答案
The文档 [ ^ ]没有显示任何这样的构造函数。你在哪里听说过这个?
The documentation[^] does not show any such constructor. Where did you hear of this?
这篇关于在不使用拆分功能的情况下将CSV拆分为数组列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!