示例#1
0
        public static AppAnalysis AppAnalysisFactory(string csvAddress)
        {
            var appAnalysis = new AppAnalysis();

            using (TextFieldParser parser = new TextFieldParser(csvAddress))
            {
                parser.TextFieldType = FieldType.Delimited;
                parser.SetDelimiters(",");
                var fields = parser.ReadFields();
                while (!parser.EndOfData)
                {
                    fields = parser.ReadFields();
                    appAnalysis.AppendApp(fields);
                }
            }
            return(appAnalysis);
        }
示例#2
0
        public static AppAnalysis AppAnalysisFactory(string csvAddress)
        {
            var appAnalysis = new AppAnalysis();

            using (TextFieldParser parser = new TextFieldParser(csvAddress))
            {
                parser.TextFieldType = FieldType.Delimited;
                parser.SetDelimiters(",");
                var fields = parser.ReadFields();
                while (!parser.EndOfData)
                {
                    fields = parser.ReadFields();
                    appAnalysis.AppendApp(fields);
                }
            }
            return(appAnalysis);

            //AppAnalysis appAnalysis = new AppAnalysis();
            //var appsData=File.ReadAllLines(appDataPath);
            //appsData.Skip(1)
            //        .ToList()
            //        .ForEach(d => appAnalysis.Apps.Add(new AppData(d.Split(','))));
            //return appAnalysis;
        }