All pastes #2101789 Raw Edit

Untitled

public text v1 · immutable
#2101789 ·published 2012-01-10 07:16 UTC
rendered paste body
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ConsoleApplication1
{
    class Read
    {
        
        public void readFile()
        {
            List<Array> list = new List<Array>();
            int i = 0;
            foreach (string line in File.ReadAllLines(@"C:\Users\mmoncell\Documents\perl.txt"))
            {
                if (i == 0)
                {
                    string var1 = line;
                    Console.WriteLine(var1);
                }
                else
                {   
                    string[] parts = line.Split(',');
                    list.Add(parts);
                    Console.Write("line{0} elements: ",i);

                    // list.ElementAt(i-1) => parts   ..eto ung array variable per line

                    for (int j = 0; j < list.ElementAt(i - 1).Length; j++)
                    {
                        Console.Write("{0}, ", list.ElementAt(i-1).GetValue(j)); //per element sa loob nung array variable
                    }
                    Console.WriteLine();
                }
                i++;
                
            }
            Console.ReadKey();
        }
    }
}