private static void dummy() { using (var csvFile = new CsvFile<Client>("clients.csv")) { for (int i = 0; i < 1000000; i++) { var user = Client.RandomClient(); csvFile.Append(user); } } }
private static void dummy() { using (var csvFile = new CsvFile <Client>("clients.csv")) { for (int i = 0; i < 1000000; i++) { var user = Client.RandomClient(); csvFile.Append(user); } } }
public void SaveData() { //Write each location to a row in the CSV file using (var file = new CsvFile<PennySquisherLocation>(CsvFile)) { Locations.ForEach(l => file.Append(l)); } //Also write data to JSON var data = JsonConvert.SerializeObject(this); File.WriteAllText(JsonFile, data); }
public void Append_when_missing_a_newline() { var data = baseData; var expected = baseData + @" DATA2 "; using (var m = Streams.ToStream(data)) { var written = Streams.ToString(CsvFile.Append(m, new[] { new Data { C1 = "DATA2" } })); //append data Assert_AreEqual_ExceptNewline(expected, written); } }
private static void CreateRandomClientsCsvFile() { Console.WriteLine(); Console.WriteLine("Creating Random Clients..."); using (var csvFile = new CsvFile<Client>("clients.csv")) { for (int i = 0; i < 1000000; i++) { var user = Client.RandomClient(); user.ClientId = i + 100; csvFile.Append(user); if ((i + 1) % 1000 == 0) Console.Write(string.Format("Writing {0} ({1}/{2})\r", "clients.csv", i + 1, 1000000)); } } Console.WriteLine(); }
private static void CreateRandomClientsCsvFile() { Console.WriteLine(); Console.WriteLine("Creating Random Clients..."); using (var csvFile = new CsvFile <Client>("clients.csv")) { for (int i = 0; i < 1000000; i++) { var user = Client.RandomClient(); user.ClientId = i + 100; csvFile.Append(user); if ((i + 1) % 1000 == 0) { Console.Write(string.Format("Writing {0} ({1}/{2})\r", "clients.csv", i + 1, 1000000)); } } } Console.WriteLine(); }