Esempio n. 1
0
    static void ReadRoles(MoviesDB moviesDB, String path, bool printSep, int width)
    {
        byte[] content = File.ReadAllBytes(path + "/roles.csv");

        long msecs1 = Environment.TickCount;

        CsvReader reader = new CsvReader(content);

        reader.SkipLine();
        while (!reader.Eof())
        {
            int actorId = (int)reader.ReadLong();
            reader.Skip(';');
            int movieId = (int)reader.ReadLong();
            reader.Skip(';');
            String role = reader.ReadString();
            reader.SkipLine();

            moviesDB.AddRole(actorId, movieId, role);
        }

        long msecs2 = Environment.TickCount;

        PrintTime(msecs2 - msecs1, printSep, width);
    }