Exemplo n.º 1
0
        private void ConvertEGB2CSV()
        {
            if (_cmd.Args.Count != 2)
            {
                Console.WriteLine(@"Must specify a source and target.");
                return;
            }

            String sourceFile = _cmd.Args[0];
            String targetFile = _cmd.Args[1];

            AnalystFileFormat format1 =
                ConvertStringConst.String2AnalystFileFormat(_cmd.PromptString("format", "decpnt|comma"));
            CSVFormat format = ConvertStringConst.ConvertToCSVFormat(format1);

            new FileInfo(targetFile).Delete();
            IDataSetCODEC codec  = new CSVDataCODEC(targetFile, format, false);
            var           loader = new BinaryDataLoader(codec)
            {
                Status = new ConsoleStatusReportable()
            };

            _sw.Start();
            loader.Binary2External(sourceFile);
        }