Пример #1
0
        public static SomeData FromCsv(string csvLine)
        {
            string[] values   = csvLine.Split(',');
            SomeData someData = new SomeData();

            someData.GEO_id              = Convert.ToString(values[0]);
            someData.GEO_id2             = Convert.ToString(values[1]);
            someData.GEO_displaylabel    = Convert.ToString(values[2]);
            someData.NAICS_id            = Convert.ToString(values[3]);
            someData.NAICS_display_label = Convert.ToString(values[4]);
            someData.YEAR_id             = Convert.ToString(values[5]);
            someData.RCPTOTI             = Convert.ToString(values[6]);
            someData.ESTAB   = Convert.ToString(values[7]);
            someData.ECTGE20 = Convert.ToString(values[8]);
            someData.EMP     = Convert.ToString(values[9]);
            someData.PAYANN  = Convert.ToString(values[10]);
            someData.EMPAVPW = Convert.ToString(values[11]);
            someData.HOURS   = Convert.ToString(values[12]);
            someData.PAYANPW = Convert.ToString(values[13]);
            someData.CSTMTOT = Convert.ToString(values[14]);
            someData.RCPTOT  = Convert.ToString(values[15]);
            someData.VALADD  = Convert.ToString(values[16]);
            someData.CEXTOT  = Convert.ToString(values[17]);
            return(someData);
        }
Пример #2
0
        //dotnet\TestAkka\TestAkka\bin\Debug\SomeData.csv
        public List <SomeData> ReadFromCsvFile()
        {
            List <SomeData> values = File.ReadAllLines(@"DummyTestData\SomeData.csv")
                                     .Skip(1)
                                     .Select(v => SomeData.FromCsv(v))
                                     .ToList();

            return(values);
        }