Пример #1
0
        static int Main(string[] args)
        {
            if (args.Length <= 0)
            {
                Console.WriteLine("Please enter the file name as the parameter. (File path together)" +
                                  Environment.NewLine +
                                  "Ex: PlaylistStatistics.exe \"C:\\document.csv\"");
                Console.ReadKey();

                return(Environment.ExitCode);
            }

            ConsoleHeader();


            string   outputPath  = Path.GetDirectoryName(args[0]);
            DateTime processDate = new DateTime(2016, 08, 10);

            // In the .csv file provided to us, the data is divided by tab space(\t).
            PlaylistController playlistController = new PlaylistController(args[0], '\t');

            var clientPlaylistHistories = playlistController.ClientPlaylistHistories(processDate);

            playlistController.WriteFileClientPlaylistHistories(clientPlaylistHistories, "CLIENT_ID\tDISTINCT_PLAY_COUNT", outputPath, "ClientPlaylistHistories.txt");

            var playlistStatistics = playlistController.PlaylistStatistics(processDate);

            playlistController.WriteFilePlaylistStatistics(playlistStatistics, "DISTINCT_PLAY_COUNT\tCLIENT_COUNT", outputPath, "PlaylistStatistics.txt");


            Console.WriteLine("Çıkmak için enter'a basınız..");
            Console.ReadKey();

            return(0);
        }
Пример #2
0
        static void Main(string[] args)
        {
            string   outputPath  = Environment.CurrentDirectory;
            DateTime processDate = new DateTime(2016, 08, 10);

            // In the .csv file provided to us, the data is divided by tab space(\t).
            PlaylistController playlistController = new PlaylistController(testPlaylistHistory);

            var clientPlayliesHistories = playlistController.ClientPlaylistHistories(processDate);

            playlistController.WriteFileClientPlaylistHistories(clientPlayliesHistories, "CLIENT_ID\tDISTINCT_PLAY_COUNT", outputPath, "ClientPlaylistHistories.txt");

            var playlistStatistics = playlistController.PlaylistStatistics(processDate);

            playlistController.WriteFilePlaylistStatistics(playlistStatistics, "DISTINCT_PLAY_COUNT\tCLIENT_COUNT", outputPath, "PlaylistStatistics.txt");
        }