开发者

insert values from txt toan 2-demensions array or Arraylist using c#

I am new in programming and want some help with this.

I have to read a fixed length txt file, and to insert two values form each line in a two dimension array or arraylist. I think that the best choise is the a dynamic array...

I have read the relative topics but it;s not clear to me yet...

Could give me some help please.

Than开发者_运维技巧k you in advance!

I cannot attach any code as I'am out of office know...


In order to read a text file line by line:

using (var file = File.OpenText("foo.txt"))
{
    string line;
    while ((line = file.ReadLine()) != null)
    {
        // line will contain the current line being read
    }
}

Then you could use a List<T> to hold the data being parsed from each line.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜