Exemplo n.º 1
0
        public static FileSolution LoadCsvFile(string _path)
        {
            var file = new FileSolution(_path, null);

            file.LoadCsv();
            return(file);
        }
Exemplo n.º 2
0
        public static FileSolution ExportCsvFile(string _path, List <DataSolution> _rows)
        {
            var file = new FileSolution(_path, _rows);

            file.ExportCsv();
            return(file);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Write a csv file where all text values are analyzed and embedded into numerical values. This is done to
        /// corresponding to the input
        /// </summary>
        /// <param name="path"></param>
        /// <param name="sep"></param>
        public static void ExportToFile(string path, List <DataSolution> rows, string sep = ",")
        {
            // To prevent errors, we'll write to a temporary file, then change its file name
            string temp = Path.ChangeExtension(path, ".temp");

            if (File.Exists(temp))
            {
                File.Delete(temp);
            }
            if (File.Exists(path))
            {
                File.Delete(path);
            }

            var file = FileSolution.ExportCsvFile(path, rows);
        }