<commit_before>﻿using System;
using System.IO;
using System.Windows.Forms;


namespace Common.Common
{
    public static class SaveToFile
    {
        public static void SaveTextFiletoSelectedDirectory(this string file)
        {
            using (var saveFile = new SaveFileDialog())
            {
                SetTextFileFiltersForSaving(saveFile);
                if (saveFile.ShowDialog() == DialogResult.OK)
                {
                    File.WriteAllText(saveFile.FileName, file);
                }
            }
        }

        /// <summary>
        /// Due to restrictions in read/write privilage this is the default folder
        /// for saving batch files to.
        /// </summary>
        /// <param name="file"></param>
        public static void SaveFiletoADefaultDirectory(this string file)
        {
            using (var saveFile = new SaveFileDialog())
            {
                const string directory = @"C:\Users\Public\Documents\835 Batch\";
                SetTextFileFiltersForSaving(saveFile);
                Directory.CreateDirectory(directory);
                var path = $"{directory}{saveFile.FileName}.{saveFile.DefaultExt}";
                File.WriteAllText(path, file);

            }
        }

        private static void SetTextFileFiltersForSaving(SaveFileDialog saveFile)
        {
            saveFile.Filter = "Text Files| *.txt";
            saveFile.DefaultExt = "txt";
            saveFile.FileName = DateTime.Now.ToString("yyyy_MM_dd_hmmssff");
        }

    }
}
<commit_msg>Updated default path for saving multiple files. Set default directory to appear when saving a single file.<commit_after>﻿using System;
using System.IO;
using System.Windows.Forms;


namespace Common.Common
{
    public static class SaveToFile
    {
        public static void SaveTextFiletoSelectedDirectory(this string file)
        {
            using (var saveFile = new SaveFileDialog())
            {
                SetTextFileFiltersForSaving(saveFile);
                if (saveFile.ShowDialog() == DialogResult.OK)
                {
                    File.WriteAllText(saveFile.FileName, file);
                }
            }
        }

        public static void SaveFiletoADefaultDirectory(this string file)
        {
            using (var saveFile = new SaveFileDialog())
            {
                const string directory = @"\835 Batch\";
                string filePath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                {
                    Directory.CreateDirectory(filePath+directory);
                }
                SetTextFileFiltersForSaving(saveFile);
                Directory.CreateDirectory(filePath);
                var path = $"{filePath}{directory}{saveFile.FileName}.{saveFile.DefaultExt}";
                File.WriteAllText(path, file);

            }
        }

        private static void SetTextFileFiltersForSaving(SaveFileDialog saveFile)
        {
            saveFile.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

            saveFile.Filter = "Text Files| *.txt";
            saveFile.DefaultExt = "txt";
            saveFile.FileName = DateTime.Now.ToString("yyyy_MM_dd_hmmssff");
        }

    }
}

{'fraction_non_alphanumeric': 0.08906633906633907, 'fraction_numerical': 0.0018427518427518428, 'mean_word_length': 1.834638816362054, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1358153', 'n_tokens_mistral': 843, 'n_tokens_neox': 797, 'n_words': 172}