static void Main(string[] args) { Console.WriteLine("Parsing " + INPUT_FILENAME + "..."); // Clears the log file System.IO.File.WriteAllText(LOG_PATH, String.Empty); FecParser parser = new FecParser(); // Reads through every line in the JSON file and passes it to a // JSON record handler string line; int count = 0; System.IO.StreamReader sr = new System.IO.StreamReader(INPUT_PATH); while ((line = sr.ReadLine()) != null) { if (count % 1000 == 0) { Console.WriteLine("Processing element " + count + "..."); } parser.HandleRecord(line, count); count++; } sr.Close(); Console.WriteLine("*****************"); Console.WriteLine("Finished parsing!"); Console.WriteLine("*****************"); // Pauses program execution until the user hits Enter Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("Parsing " + INPUT_FILENAME + "..."); // Clears the log file System.IO.File.WriteAllText(LOG_PATH, String.Empty); FecParser parser = new FecParser(); // Reads through every line in the JSON file and passes it to a // JSON record handler string line; int count = 0; System.IO.StreamReader sr = new System.IO.StreamReader(INPUT_PATH); while ((line = sr.ReadLine()) != null) { if (count % 1000 == 0) Console.WriteLine("Processing element " + count + "..."); parser.HandleRecord(line, count); count++; } sr.Close(); Console.WriteLine("*****************"); Console.WriteLine("Finished parsing!"); Console.WriteLine("*****************"); // Pauses program execution until the user hits Enter Console.ReadLine(); }