Example #1
0
        public string SaveOne(Dictionary <int, double> data, string toFilePath = null)
        {
            var sb = new StringBuilder();

            foreach (var item in data)
            {
                sb.Append(item.Key + _csvWriter.Separator + item.Value);
                sb.Append(Environment.NewLine);
            }

            string header = "Shift index, Symbolic autocorrelation value " +
                            Environment.NewLine;

            _csvWriter.WriteData(header, toFilePath, true);
            string output = _csvWriter.WriteData(sb.ToString(), toFilePath, true);

            return(output);
        }
        public string Save(CompressionRates compRate, string toFilePath = null)
        {
            string sData = String.Empty;

            compRate.Rates.ForEach(rate => sData = String.Concat(sData, rate, _csvWriter.Separator));
            sData = sData.TrimEnd(_csvWriter.Separator.ToCharArray());
            string record = String.Format("{0}{1}{2}", compRate.Person.Id, _csvWriter.Separator, sData);

            record = String.Concat(record, Environment.NewLine);

            string output = _csvWriter.WriteData(record, toFilePath, true, true);

            return(output);
        }