static void Main(string[] args)
        {
            string projectPath = Path.GetFullPath(@"..\..\..\..\");
            string readFile    = $"{projectPath}TempFiles\\data.csv";
            string writeFile   = $"{projectPath}TempFiles\\processed_data.csv";

            DataParser dp     = new DataParser();
            CsvHandler ch     = new CsvHandler();
            string     choice = "";

            while (!choice.Equals("3"))
            {
                Console.WriteLine("Select from the Following Options" +
                                  "\n1. Process CSV\n2. Process CSV using Parser \n3. Exit" +
                                  "\nNote Only Option 1 is formatted correctly to Pass all Tests");

                Console.Write("Enter Choice:  ");
                choice = Console.ReadLine();

                try
                {
                    switch (choice)
                    {
                    case "1":    //Process CSV

                        Func <List <List <string> >, List <List <string> > > dataHandler = dp.StripWhiteSpace;
                        dataHandler += dp.StripQuotes;
                        dataHandler += RemoveHashes;
                        ch.ProcessCsv(readFile, writeFile, dataHandler);
                        Console.WriteLine($"\n{writeFile} file created\n");
                        break;

                    case "2":    //Process CSV and Capitalise all Data using Parser

                        Parser parsee = dp.StripWhiteSpace;
                        parsee += dp.StripQuotes;
                        parsee += RemoveHashes;
                        parsee += CapData;
                        ch.ProcessCsv(readFile, writeFile, parsee);
                        Console.WriteLine($"\n{writeFile} file created using Parser Type\n");

                        break;

                    case "3":    //Exits Program
                        break;

                    default:
                        Console.WriteLine("\nInvalid Option\n");
                        break;
                    }
                }
                catch (Exception exc)
                {
                    Console.WriteLine($"\n{exc.Message}\n");
                }
            }

            Console.WriteLine("\nGood Bye");
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            var csvHandler = new CsvHandler();

            var genericParser = CreateGenericParser();

            csvHandler.ProcessCsv(readFilePath, writeFilePath, genericParser);

            var parser = CreateParser();

            csvHandler.ProcessCsv(readFilePath, optionalWriteFilePath, parser);
        }
Beispiel #3
0
        public static void Main(string[] args)
        {
            Func <List <List <string> >, List <List <string> > > cleanData = new Func <List <List <string> >, List <List <string> > >(StripWhiteSpaceAndQuotes);

            cleanData += StripHashes;

            CsvHandler csv = new CsvHandler();

            csv.ProcessCsv(inputPath, outputPath, cleanData);
        }
Beispiel #4
0
        public static void Main(string[] args)
        {
            CsvHandler ch = new CsvHandler();



            ch.ProcessCsv("F:/YEAR 2/Dip-Seminar-Delegates-Lambda-Linq_Exercises/Files/Files/data.csv", "F:/YEAR 2/Dip-Seminar-Delegates-Lambda-Linq_Exercises/Files/Files/processed_data.csv", dataHandler);


            Console.ReadLine();
        }
        public static void Main(string[] args)
        {
            DataParser dataparser = new DataParser();
            CsvHandler csvhandler = new CsvHandler();

            Func <List <List <string> >, List <List <string> > > x = new Func <List <List <string> >, List <List <string> > >(dataparser.StripQuotes);

            x += dataparser.StripWhiteSpace;
            x += RemoveHash;
            csvhandler.ProcessCsv(@"C:\Users\Hamish\source\repos\Dip-Seminar-Delegates-Lambda-Linq_Exercises\data.csv", @"C:\Users\Hamish\source\repos\Dip-Seminar-Delegates-Lambda-Linq_Exercises\processed_data.csv", x);
        }
Beispiel #6
0
        public static void Main(string[] args)
        {
            string csvPath   = @"D:\Code\UNI\weeklytasks\Delegates\Files\Files\data.csv";
            string writePath = @"D:\Code\UNI\weeklytasks\Delegates\Files\Files\write.csv";

            var ch = new CsvHandler();

            ch.ProcessCsv(csvPath, writePath, (data) => data);

            Console.ReadKey();
        }
Beispiel #7
0
        public static void Main(string[] args)
        {
            var filePath  = "///home/keags/Development/delegates_task/data.csv";
            var writePath = "///home/keags/Development/delegates_task/write.csv";

            var _ch = new CsvHandler();

            _ch.ProcessCsv(filePath, writePath, (x) => x);

            Console.Read();
        }
Beispiel #8
0
        static void Main(string[] args)
        {
            CsvHandler ch = new CsvHandler();
            DataParser dp = new DataParser();

            Func <List <List <string> >, List <List <string> > > x = dp.StripQuotes;

            x += dp.StripWhiteSpace;
            x += dp.StripHashes;

            ch.ProcessCsv("data.csv", "processed_data.csv", x);
        }
Beispiel #9
0
        static void Main(string[] args)
        {
            CsvHandler csvHandler = new CsvHandler();
            DataParser dataParser = new DataParser();

            Func <List <List <string> >, List <List <string> > > data = dataParser.StripQuotes;

            data += dataParser.StripWhiteSpace;
            data += RemoveHashes;

            csvHandler.ProcessCsv("data.csv", "processed_data.csv", data);
        }
Beispiel #10
0
        public static void Main(string[] args)
        {
            DataParser _dp  = new DataParser();
            CsvHandler _csv = new CsvHandler();

            Func <List <List <string> >, List <List <string> > > process = new Func <List <List <string> >, List <List <string> > >(_dp.StripQuotes);

            process += _dp.StripWhiteSpace;
            process += StripHash;

            _csv.ProcessCsv("E:/data.csv", "E:/processed_data.csv", process);
        }
Beispiel #11
0
        public static void Main(string[] args)
        {
            string openFilePath  = "C:\\Users\\cjmco\\Downloads\\delegates\\data.csv";
            string writeFilePath = "C:\\Users\\cjmco\\Downloads\\delegates\\outPut.csv";

            var csvHan = new CsvHandler();

            csvHan.ProcessCsv(openFilePath, writeFilePath, (x) => x);

            Console.WriteLine("Completed Successfully ;)");
            Console.ReadLine();
        }
        public static void Main(string[] args)
        {
            DataParser dp = new DataParser();

            Func <List <List <string> >, List <List <string> > > process = dp.StripQuotes;

            process += dp.StripWhiteSpace;
            process += StripHash;

            CsvHandler csv = new CsvHandler();

            csv.ProcessCsv("/Users/STUDENT/Desktop/delegates/data.csv", "/Users/STUDENT/Desktop/delegates/processed_data.csv", process);
        }
Beispiel #13
0
        public static void Main(string[] args)
        {
            DataParser  data      = new DataParser();
            CsvHandler  handler   = new CsvHandler();
            FileHandler filehand  = new FileHandler();
            string      readPath  = @"C:\Users\Admin\source\repos\Delegates\Files\data.csv";
            string      writePath = @"C:\Users\Admin\source\repos\Delegates\Files\processed_data.csv";
            Func <List <List <string> >, List <List <string> > > Trimmer = new Func <List <List <string> >, List <List <string> > >(data.StripQuotes);

            Trimmer += data.StripWhiteSpace;
            Trimmer += StripHash;
            handler.ProcessCsv(readPath, writePath, Trimmer);
        }
Beispiel #14
0
        static void Main(string[] args)
        {
            var fileHandler = new FileHandler();
            var dataParser  = new DataParser();
            var csvHandler  = new CsvHandler();

            var dataHandler = new Func <List <List <string> >, List <List <string> > >(dataParser.StripQuotes);

            dataHandler += dataParser.StripWhiteSpace;
            dataHandler += RemoveHashes;

            csvHandler.ProcessCsv("C:/Users/peter/Documents/GitHub/Dip_Delegates_Task/data.csv", "C:/Users/peter/Documents/GitHub/Dip_Delegates_Task/processed_data.csv", dataHandler);
        }
Beispiel #15
0
        static void Main(string[] args)
        {
            var fileHandler = new FileHandler();
            var dataParser  = new DataParser();
            var csvHandler  = new CsvHandler();

            var dataHandler = new Func <List <List <string> >, List <List <string> > >(dataParser.StripQuotes);

            dataHandler += dataParser.StripWhiteSpace;
            dataHandler += RemoveHashes;

            csvHandler.ProcessCsv("TempFiles/data.csv", "TempFiles/processed_data.csv", dataHandler);
        }
        public static void Main(string[] args)
        {
            string     _readFilePath  = "/Users/ishmyles/Desktop/Dip-Seminar-Delegates-Lambda-Linq_Exercises-master/data.csv";
            string     _writeFilePath = "/Users/ishmyles/Desktop/Dip-Seminar-Delegates-Lambda-Linq_Exercises-master/processed_data.csv";
            DataParser dp             = new DataParser();
            CsvHandler ch             = new CsvHandler();

            Func <List <List <string> >, List <List <string> > > pDataHandler = dp.StripQuotes;

            pDataHandler += dp.StripWhiteSpace;
            pDataHandler += StripHashTag;

            ch.ProcessCsv(_readFilePath, _writeFilePath, pDataHandler);
        }
Beispiel #17
0
        static void Main(string[] args)
        {
            string readFileLoc = "C:/Users/Jayde/OneDrive/Uni/Delegates Task/data.csv";
            string writeFileLoc = "C:/Users/Jayde/OneDrive/Uni/Delegates Task/data2.csv";
            
            CsvHandler csvHandler = new CsvHandler();
            DataParser dataParser = new DataParser();

            Func<List<List<string>>, List<List<string>>> stripLines = dataParser.StripQuotes;
            stripLines += dataParser.StripWhiteSpace;
            stripLines += RemoveHashes;

            csvHandler.ProcessCsv(readFileLoc, writeFileLoc, stripLines);
        }
Beispiel #18
0
        public static void Main(string[] args)
        {
            string readFilePath  = "/Users/sharm/Documents/data.csv";
            string writeFilePath = "/Users/sharm/Documents/process_data.csv";


            CsvHandler csvHan  = new CsvHandler();
            DataParser dParser = new DataParser();
            //process p = new process(dParser.StripQuotes);
            Func <List <List <string> >, List <List <string> > > process = new Func <List <List <string> >, List <List <string> > >(dParser.StripQuotes);

            process += dParser.StripWhiteSpace;
            process += removeHashtag;
            csvHan.ProcessCsv(readFilePath, writeFilePath, process);
        }
Beispiel #19
0
        public static void Main(string[] args)
        {
            DataParser  dataParser   = new DataParser();
            CsvHandler  csvHandler   = new CsvHandler();
            FileHandler fileHandler  = new FileHandler();
            string      csvReadPath  = @"C:\Users\kbke2\Desktop\TAFE 2018\Dev Ops\Week 7\Files\data.csv";
            string      csvWritePath = @"C:\Users\kbke2\Desktop\TAFE 2018\Dev Ops\Week 7\Files\processed_data.csv";

            Func <List <List <string> >, List <List <string> > > processBlueprint = new Func <List <List <string> >, List <List <string> > >(dataParser.StripQuotes);

            processBlueprint += dataParser.StripWhiteSpace;
            processBlueprint += StripHash;

            csvHandler.ProcessCsv(csvReadPath, csvWritePath, processBlueprint);
        }
Beispiel #20
0
        public static void Main(string[] args)
        {
            FileHandler fileHandler = new FileHandler();
            DataParser  dataParser  = new DataParser();
            CsvHandler  csvHandler  = new CsvHandler();

            string ReadFilePath  = @"C:\Users\Muham\Desktop\Dip-Seminar-Delegates-Lambda-Linq_Exercises-master\Files\data.csv";
            string WriteFilePath = @"C:\Users\Muham\Desktop\Dip-Seminar-Delegates-Lambda-Linq_Exercises-master\Files\processed_data.csv";

            List <List <string> > handler(List <List <string> > data) => RemoveHash(dataParser.StripWhiteSpace
                                                                                        (dataParser.StripQuotes(data)));

            csvHandler.ProcessCsv(ReadFilePath, WriteFilePath, handler);
            Console.ReadKey();
        }
        public static void Main(string[] args)
        {
            string     readfilepath  = @"C:\Users\101900910\source\repos\Delegates2\Files\data.csv";
            string     writefilepath = @"C:\Users\101900910\source\repos\Delegates2\Files\processed_data.csv";
            DataParser dataParser    = new DataParser();

            List <List <string> > handler(List <List <string> > data) =>
            removeHash(dataParser.StripWhiteSpace(dataParser.StripQuotes(data)));

            CsvHandler csvHandler = new CsvHandler();

            csvHandler.ProcessCsv(readfilepath, writefilepath, handler);

            Console.WriteLine("Done.");
            Console.ReadLine();
        }
Beispiel #22
0
        public static void Main(string[] args)
        {
            string readFile  = "C:/Users/STUDENT/Desktop/Dip-Seminar-Delegates-Lambda-Linq_Exercises-master/data.csv";
            string writeFile = "C:/Users/STUDENT/Desktop/Dip-Seminar-Delegates-Lambda-Linq_Exercises-master/process_data.csv";


            DataParser rty = new DataParser();


            Func <List <List <string> >, List <List <string> > > datahandler = null;

            datahandler += rty.StripQuotes;
            datahandler += rty.StripWhiteSpace;
            datahandler += removeHashTag;

            CsvHandler csvHandler = new CsvHandler();

            csvHandler.ProcessCsv(readFile, writeFile, datahandler);
        }
Beispiel #23
0
        public static void Main(string[] args)
        {
            string readfilePath  = @"C:/Users/Nathan/source/repos/DelegatesTask/Files/data.csv";
            string writefilePath = @"C:/Users/Nathan/source/repos/DelegatesTask/Files/processed_data.csv";

            DataParser dataParser = new DataParser();

            List <List <string> > handler(List <List <string> > data) =>

            StripHash(dataParser.StripWhiteSpace(dataParser.StripQuotes(data)));

            CsvHandler csvHandler = new CsvHandler();

            csvHandler.ProcessCsv(readfilePath, writefilePath, handler);

            Console.WriteLine("Done. ");

            Console.ReadLine();
        }
Beispiel #24
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Press any key to sanitise data...");
            Console.ReadKey();
            Console.WriteLine("Working...");

            DataParser dataParser = new DataParser();

            List <List <string> > Stripper(List <List <string> > data) =>
            StripHash(dataParser
                      .StripWhiteSpace(dataParser
                                       .StripQuotes(data)));

            CsvHandler csvHandler = new CsvHandler();

            csvHandler.ProcessCsv(@"C:\Diploma-at-28-April\OOP\Week-11-Delegates-n-stuffz\Files\data.csv", @"C:\Diploma-at-28-April\OOP\Week-11-Delegates-n-stuffz\Files\processed_data.csv", Stripper);

            Console.WriteLine("File cleansed.");
            Console.ReadKey();
        }
        public static void Main(string[] args)
        {
            FileHandler fileHandler = new FileHandler();
            DataParser  dataParser  = new DataParser();
            CsvHandler  csvHandler  = new CsvHandler();

            string ReadFilePath  = @"D:\GitHub\Delegates_Lambda_Linq_Exercise\Files\data.csv";
            string WriteFilePath = @"D:\GitHub\Delegates_Lambda_Linq_Exercise\Files\processed_data.csv";

            List <List <string> > handler(List <List <string> > data) => RemoveHash(dataParser.StripWhiteSpace
                                                                                        (dataParser.StripQuotes(data)));

            // csvHandler.ProcessCsv(ReadFilePath, WriteFilePath, data => trim(data));
            //Func<List<List<string>>, List<List<string>>> trim = new Func<List<List<string>>, List<List<string>>>(dataParser.StripQuotes);
            //trim = trim + dataParser.StripWhiteSpace;
            //trim = trim + dataParser.StripQuotes;
            //trim = trim + RemoveHash;

            csvHandler.ProcessCsv(ReadFilePath, WriteFilePath, handler);
            Console.ReadKey();
        }
Beispiel #26
0
        static void Main(string[] args)
        {
            DataParser _dp         = new DataParser();
            CsvHandler _ch         = new CsvHandler();
            Parser     _Parser     = new Parser(_dp.StripWhiteSpace);
            string     _csvPath    = Environment.GetEnvironmentVariable("HOME") + "/Users/Mitchell/Desktop/Dip_Delegates_Task-master/Dip_Delegates_Task-master/Data/data.csv";
            string     _writeFile  = Environment.GetEnvironmentVariable("HOME") + "/Users/Mitchell/Desktop/Dip_Delegates_Task-master/Dip_Delegates_Task-master/Data/processed_data.csv";
            string     _writeFile2 = Environment.GetEnvironmentVariable("HOME") + "/Users/Mitchell/Desktop/Dip_Delegates_Task-master/Dip_Delegates_Task-master/Data/processed_data2.csv";

            Func <List <List <string> >, List <List <string> > > datacleaner = new Func <List <List <string> >, List <List <string> > >(_dp.StripWhiteSpace);

            datacleaner += _dp.StripQuotes;
            datacleaner += RemoveHashes;
            //This is the optional task implemented in the program.cs
            _ch.ProcessCsv(_csvPath, _writeFile, datacleaner);
            _Parser += _dp.StripQuotes;
            _Parser += RemoveHashes;
            _Parser += _dp.CapitalizeAll;
            _ch.ProcessCsvAndCapitalize(_csvPath, _writeFile2, _Parser);
            Console.ReadKey(true);
        }
Beispiel #27
0
        static void Main(string[] args)
        {
            //read write locations change path if needed
            string readLoc  = @"C:/Users/Bradley/Desktop/swinburne/diplo/ICT418/Delegates_Task/data.csv";;
            string writeLoc = @"C:/Users/Bradley/Desktop/swinburne/diplo/ICT418/Delegates_Task/processed_data.csv";

            //delegate
            Func <List <List <string> >, List <List <string> > > Process = new Func <List <List <string> >, List <List <string> > >(new DataParser().StripQuotes);

            Process += new DataParser().StripWhiteSpace;
            Process += RemoveHashes;

            //read file process data and write to a file
            CsvHandler csv = new CsvHandler();

            csv.ProcessCsv(readLoc, writeLoc, Process);

            //fluff replace with user interface perhaps
            Console.WriteLine("data processed press any key to continue");
            Console.ReadKey();
        }