Esempio n. 1
0
        public static void ExecLevel(string baseDir, string level, ExecLevelWithListDelegate func)
        {
            CheckBaseDir(ref baseDir, level, out var inputDir, out var outputDir);

            _ExecOnInputDirWithOutputDir(inputDir, outputDir, func);
        }
Esempio n. 2
0
        private static void _ExecOnInputDirWithOutputDir(string inputDirPath, string outputDirPath, ExecLevelWithListDelegate func)
        {
            var files = Directory.GetFiles(inputDirPath);

            foreach (var file in files)
            {
                var list = new List <string>();
                func(File.ReadAllLines(file), list);

                using (var streamWriter =
                           File.CreateText(outputDirPath + "\\" + file.Split('\\').LastOrDefault() + "-output.txt"))
                {
                    foreach (var line in list)
                    {
                        streamWriter.WriteLine(line);
                    }
                }
            }
        }