private static void Test16() { using var fs = new FileStream("d:\\1233.csv", FileMode.OpenOrCreate, FileAccess.Read); var csv = new CsvFile(fs); var obj = csv.ReadLine(); csv.Dispose(); }
/// <summary>测试写入CSV文件</summary> private static void Test17() { using var fs = new FileStream("d:\\1233.csv", FileMode.OpenOrCreate, FileAccess.Write); var csv = new CsvFile(fs); csv.WriteLine("123", true, 111111111, DateTime.Now.ToString("yyyyMMdd"), "2222222222222222222222222222"); csv.Dispose(); }
private void WritePoints(TimePoint[] data, AlignModes mode) { var f = $"Algorithms/lttb_{mode}_sampled.csv".GetFullPath(); if (File.Exists(f)) { File.Delete(f); } using var csv = new CsvFile(f, true); for (var i = 0; i < data.Length; i++) { csv.WriteLine(data[i].Time, data[i].Value); } csv.Dispose(); }
private void WritePoints(ISampling sample, TimePoint[] data, AlignModes mode, String prefix = null) { if (prefix.IsNullOrEmpty()) { prefix = "avg"; } var f = $"Algorithms/{prefix}_{mode}_sampled.csv".GetFullPath(); //if (sample.BucketSize > 0) f = $"Algorithms/avgfill_{mode}_sampled.csv".GetFullPath(); if (File.Exists(f)) { File.Delete(f); } using var csv = new CsvFile(f, true); for (var i = 0; i < data.Length; i++) { csv.WriteLine(data[i].Time, data[i].Value); } csv.Dispose(); //XTrace.WriteLine(f); }