static void Main(string[] args) { runScript(); split(); var switches = new ConsoleSwitches(args); Console.WriteLine("Starting..."); Exec(switches); Console.WriteLine("Completed"); }
private static void Exec(ConsoleSwitches switches) { var schema = string.Empty;//switches["/schema"]; var table = switches["/table"]; var source = switches["/source"]; var destination = switches["/destination"]; var content = File.ReadAllText(source); var options = new Options() { Schema = schema, TableName = table, Separator = ",", FirstRowIsHeader = true }; var data = (new Parser(content, options)).ToData(); var sqlText = (new SqlServerConverter(data, options)).ToString(); File.WriteAllText(destination, sqlText); }