public void controller(string[] args) { if (args.Length >= 2 && args[0].Equals("-FTDNA")) { FamilyTreeDNA.FamilyTreeDNA ftd = new FamilyTreeDNA.FamilyTreeDNA(); ftd.Login("169551", "D3742"); } if (args.Length >= 2 && args[0].Equals("-compare")) { GedcomDatabase gd1 = new GedcomDatabase(); GedcomIndividualRecord record = new GedcomIndividualRecord(gd1, "Robert Warthen"); record.Sex = GedcomSex.Male; //record.Birth = new GedcomIndividualEvent().Date.; GedcomParser.GedcomRecordWriter grw = new GedcomParser.GedcomRecordWriter(); grw.WriteGedcom(gd1, "C:\\Temp\\Rob.ged"); } if (args.Length >= 2 && args[0].Equals("-compdir")) { sw = new StreamWriter(args[1] + "\\match.csv"); sw.WriteLine("File1,File2,Exact Match,Given1,Surname1,Birth Date1,Birth Place1,Death Date1,Death Place1,Given2,Surname2,Birth Date2,Birth Place2,Death Date2,Death Place2"); string[] files = Directory.GetFiles(args[1], "*.*", SearchOption.TopDirectoryOnly); string[] files2 = Directory.GetFiles(args[1], "*.*", SearchOption.TopDirectoryOnly); if (args.Length >= 3 && args[2].Equals("-file")) { files = new string[1]; files[0] = args[3]; } if (args.Length >= 3 && args[2].Equals("-dir")) { files2 = Directory.GetFiles(args[3], "*.*", SearchOption.TopDirectoryOnly); } foreach (string gdf1 in files) { string gedcomFile1 = gdf1.ToUpper(); if (!gedcomFile1.EndsWith(".GED")) continue; swFile1 = Path.GetFileName(gedcomFile1); //Console.WriteLine("Loading " + ); GedcomParser.GedcomRecordReader grr1 = new GedcomParser.GedcomRecordReader(); grr1.GedcomFile = gedcomFile1; try { grr1.ReadGedcom(); } catch { continue; } GedcomDatabase gd1 = grr1.Database; foreach (string gdf2 in files2) { string gedcomFile2 = gdf2.ToUpper(); if (!gedcomFile2.EndsWith(".GED")) continue; if (gedcomFile2.Equals(gedcomFile1)) continue; swFile2 = Path.GetFileName(gedcomFile2); //Console.WriteLine("Comparing " + gedcomFile1 + " and " + gedcomFile2); GedcomParser.GedcomRecordReader grr2 = new GedcomParser.GedcomRecordReader(); grr2.GedcomFile = gedcomFile2; try { grr2.ReadGedcom(); } catch { continue; } GedcomDatabase gd2 = grr2.Database; GedcomDuplicate.DuplicateFoundFunc found = new GedcomDuplicate.DuplicateFoundFunc(FoundDuplicate); float matchThreshold = 95; GedcomDuplicate.FindDuplicates(gd1, gd2, matchThreshold, found); } sw.Flush(); } sw.Close(); } if (args.Length >= 2 && args[0].Equals("-surname")) { string[] files = Directory.GetFiles(args[1], "*.*", SearchOption.AllDirectories); string surname = args[2].ToUpper(); foreach (string gedcomFile1 in files) { if (!gedcomFile1.ToUpper().EndsWith(".GED")) continue; //Console.WriteLine("Comparing " + gedcomFile1 + " for surname " + surname); GedcomParser.GedcomRecordReader grr1 = new GedcomParser.GedcomRecordReader(); grr1.GedcomFile = gedcomFile1; grr1.ReadGedcom(); GedcomDatabase gd1 = grr1.Database; bool foundfile = false; foreach (GedcomIndividualRecord rec in gd1.Individuals) { try { if (rec.Names.Count > 0 && rec.Names[0].Surname.ToUpper().Equals(surname)) { if (!foundfile) { Console.WriteLine("File " + gedcomFile1); foundfile = true; } Console.Write(" Found " + rec.Names[0].Given + " " + rec.Names[0].Surname); try { Console.Write(" Born: " + rec.Birth.Date.DateString); } catch { } try { Console.Write(" in " + rec.Birth.Place.Name); } catch { } try { Console.Write(" Died: " + rec.Death.Date.DateString); } catch { } try { Console.Write(" at " + rec.Death.Place.Name); } catch { } Console.WriteLine(); } } catch { Console.WriteLine("Can't read"); } } } } if (args.Length >= 2 && args[0].Equals("-soundex")) { string[] files = Directory.GetFiles(args[1], "*.*", SearchOption.AllDirectories); string surname = args[2].ToUpper(); string sunameSoundex = Util.GenerateSoundex(surname); foreach (string gedcomFile1 in files) { if (!gedcomFile1.ToUpper().EndsWith(".GED")) continue; //Console.WriteLine("Comparing " + gedcomFile1 + " for surname " + surname); GedcomParser.GedcomRecordReader grr1 = new GedcomParser.GedcomRecordReader(); grr1.GedcomFile = gedcomFile1; grr1.ReadGedcom(); GedcomDatabase gd1 = grr1.Database; bool foundfile = false; foreach (GedcomIndividualRecord rec in gd1.Individuals) { if (rec.Names[0].SurnameSoundex.Equals(sunameSoundex)) { if (!foundfile) { Console.WriteLine("File " + gedcomFile1); foundfile = true; } Console.Write(" Found " + rec.Names[0].Given + " " + rec.Names[0].Surname); try { Console.Write(" Born: " + rec.Birth.Date.DateString); } catch { } try { Console.Write(" in " + rec.Birth.Place.Name); } catch { } try { Console.Write(" Died: " + rec.Death.Date.DateString); } catch { } try { Console.Write(" at " + rec.Death.Place.Name); } catch { } Console.WriteLine(); } } } } if (args.Length >= 2 && args[0].Equals("-loaddir")) { string[] files = Directory.GetFiles(args[1], "*.*", SearchOption.AllDirectories); foreach (string gedcomFile1 in files) { Console.WriteLine("Loading " + gedcomFile1); GedcomParser.GedcomRecordReader grr1 = new GedcomParser.GedcomRecordReader(); grr1.GedcomFile = gedcomFile1; grr1.ReadGedcom(); GedcomDatabase gd1 = grr1.Database; foreach (GedcomIndividualRecord matchIndi in gd1.Individuals) { SaveDatabase(matchIndi); } } } if (args.Length >= 2 && args[0].ToUpper().Equals("-GEDMATCH")) { GedMatch.GedMatch gm = new GedMatch.GedMatch(); gm.WorkDir = args[1]; gm.DoMatch = true; gm.DoGed = true; gm.loadGedMatch(args[2],true); } if (args.Length >= 2 && args[0].ToUpper().Equals("-GETGEDMATCH")) { GedMatch.GedMatch gm = new GedMatch.GedMatch(); gm.WorkDir = args[1]; gm.DoGed = true; gm.loadGedMatch(args[2], true); } }
private void GetGedMatch(string nKitNbr, string html, string pre, string sex, int attempt = 0) { if (!html.Equals(" ") && !html.Equals(String.Empty) && (html.IndexOf("<a href") >= 0)) { Console.WriteLine("Loading GED Kit number " + nKitNbr); _gd1 = new GedcomDatabase(); GedcomHeader gh = new GedcomHeader(); string GedName = String.Empty; gh.Filename = "GM_" + nKitNbr + ".ged"; _gd1.Header = gh; htIndi = new System.Collections.Hashtable(50); html = html.Replace(" ", " "); html = html.Replace("<a href='", ""); string geds = String.Empty; try { geds = html.Trim().Substring(0, html.IndexOf(" title") - 2); } catch { } int ifam = html.IndexOf("id_family="); int ifame = html.IndexOf("' title"); string nfamily = html.Substring(ifam + 10,ifame-ifam-10); GetHTML(geds, WorkDir + "\\GM_SURNAME" + nKitNbr + ".html", pre); StreamReader reader = new StreamReader(WorkDir + "\\GM_SURNAME" + nKitNbr + ".html"); string line = reader.ReadLine(); bool found = false; while (line != null) { if (line.StartsWith("ANCESTORS OF: ")) { int ig = line.IndexOf("&id_ged"); int ige = line.IndexOf("'>"); int ine = line.IndexOf("</a>"); try { GedName = line.Substring(ige + 2, ine - ige - 2).Replace(" ", " ").Replace("<b>", "").Replace("</b>", ""); } catch { } try { string nindi = line.Substring(ig + 8, ige - ig - 8); if (!Directory.Exists(WorkIndiDir + nfamily)) Directory.CreateDirectory(WorkIndiDir + nfamily); GedcomIndividualRecord gir = GetGedIndi(nindi, nfamily, nKitNbr, geds, sex); } catch (Exception ex) { Console.WriteLine(ex.Message + " - " + ex.StackTrace); } found = true; break; } line = reader.ReadLine(); } reader.Close(); if (!found && attempt++ < 2) { GetHTML("http://www.gedmatch.com/surname.php?id_family=" + nfamily, WorkDir + "\\GM_SURNAME_LIST_" + nKitNbr + ".html", geds); StreamReader freader = new StreamReader(WorkDir + "\\GM_SURNAME_LIST_" + nKitNbr + ".html"); string fline = freader.ReadLine(); { //Try http://www.gedmatch.com/surname_detail.php?id_familyname=243182&id_family=5884506 try { GetHTML("http://www.gedmatch.com/surname.php?initial=A&id_family=" + nfamily, WorkDir + "\\GM_SURNAME_LIST_A_" + nKitNbr + ".html", geds); StreamReader f1reader = new StreamReader(WorkDir + "\\GM_SURNAME_LIST_A_" + nKitNbr + ".html"); string f1line = f1reader.ReadLine(); while (f1line != null) { if (f1line.IndexOf("id_familyname=") > 0) { int ifamname = f1line.IndexOf("id_familyname="); int ige = f1line.IndexOf("&"); string nfamilyname = f1line.Substring(ifamname + 14, ige - ifamname - 14); //Get http://www.gedmatch.com/surname_detail.php?id_familyname=243182&id_family=5884506 GetHTML("http://www.gedmatch.com/surname_detail.php?id_familyname=" + nfamilyname + "&id_family=" + nfamily, WorkDir + "\\GM_SURNAME_DETAIL_" + nKitNbr + ".html", geds); StreamReader dreader = new StreamReader(WorkDir + "\\GM_SURNAME_DETAIL_" + nKitNbr + ".html"); string dline = dreader.ReadLine(); while (dline != null) { if (dline.IndexOf("id_ged=") > 0) { int iged = dline.IndexOf("id_ged="); int ie = dline.IndexOf("'>"); string nindi = dline.Substring(iged + 7,ie-7-iged); html = dline.Substring(iged, ie + 4 - iged); //Call if (!Directory.Exists(WorkIndiDir + nfamily)) Directory.CreateDirectory(WorkIndiDir + nfamily); GetGedIndi(nindi, nfamily, nKitNbr, geds, sex); found = true; } dline = dreader.ReadLine(); } } f1line = f1reader.ReadLine(); } } catch (Exception ex) { Console.WriteLine(ex.Message + " - " + ex.StackTrace); } } reader.Close(); } if (found) lock (gedfile) { gedfile = WorkDir + "\\GM_" + GedName + nKitNbr + ".ged"; Console.WriteLine("Writting " + gedfile); GedcomParser.GedcomRecordWriter grw = new GedcomParser.GedcomRecordWriter(); try { grw.WriteGedcom(_gd1, gedfile); } catch { try { gedfile = WorkDir + "\\GM_" + nKitNbr + ".ged"; grw.WriteGedcom(_gd1, gedfile); } catch (Exception ex) { Console.WriteLine("Couldn't write out " + gedfile + ": " + ex.Message + " - " + ex.StackTrace); } } gedfile = string.Empty; } } }
public void controller(string[] args) { if (args.Length >= 2 && args[0].ToUpper().Equals("-FTDNA")) { FamilyTreeDNA.FamilyTreeDNA ftd = new FamilyTreeDNA.FamilyTreeDNA(); if (args.Length >= 3) ftd.Login(args[1], args[2]); else ftd.Login("169551", "D3742"); } if (args.Length >= 2 && args[0].ToUpper().Equals("-23")) { MeAnd23.MeAnd23 m23 = new MeAnd23.MeAnd23(); if (args.Length >= 3) m23.Login(args[1], args[2]); else m23.Login("*****@*****.**", "nurse1"); } if (args.Length >= 2 && args[0].ToUpper().Equals("-CSV")) { } if (args.Length >= 2 && args[0].Equals("-compare")) { GedcomDatabase gd1 = new GedcomDatabase(); GedcomIndividualRecord record = new GedcomIndividualRecord(gd1, "Robert Warthen"); record.Sex = GedcomSex.Male; //record.Birth = new GedcomIndividualEvent().Date.; GedcomParser.GedcomRecordWriter grw = new GedcomParser.GedcomRecordWriter(); grw.WriteGedcom(gd1, "C:\\Temp\\Rob.ged"); } if (args.Length >= 2 && args[0].Equals("-surlist")) { swsn = new StreamWriter(args[1] + "\\surname.csv", false); string[] files = Directory.GetFiles(args[1], "*.*", SearchOption.TopDirectoryOnly); string[] files2 = Directory.GetFiles(args[1], "*.*", SearchOption.TopDirectoryOnly); if (args.Length >= 3 && args[2].Equals("-file")) { files = new string[1]; files[0] = args[3]; } if (args.Length >= 3 && args[2].Equals("-dir")) { files2 = Directory.GetFiles(args[3], "*.*", SearchOption.TopDirectoryOnly); } foreach (string gdf1 in files) { string gedcomFile1 = gdf1.ToUpper(); if (!gedcomFile1.EndsWith(".GED")) continue; swFile1 = Path.GetFileName(gedcomFile1); //Console.WriteLine("Loading " + ); GedcomParser.GedcomRecordReader grr1 = new GedcomParser.GedcomRecordReader(); grr1.GedcomFile = gedcomFile1; try { grr1.ReadGedcom(); } catch { Console.WriteLine("Couldn't read file " + gedcomFile1); continue; } GedcomDatabase gd1 = grr1.Database; System.Collections.Generic.List<string> sv = new System.Collections.Generic.List<string>(); sv.Clear(); foreach (GedcomIndividualRecord rec in gd1.Individuals) { try { foreach (GedcomName sname in rec.Names) { string sn = sname.Surname.ToUpper(); if (sn.Length == 0) continue; if (!sv.Contains(sname.Surname.ToUpper())) { sv.Add(sname.Surname.ToUpper()); swsn.WriteLine(gedcomFile1 + ",\"" + sname.Surname.ToUpper().Replace("\"", "_") + "\""); } } } catch { Console.WriteLine("Can't read"); } } } swsn.Close(); } if (args.Length >= 2 && args[0].Equals("-compdir")) { sw = new StreamWriter(args[1] + "\\match.csv"); sw.WriteLine("File1,File2,Exact Match,Given1,Surname1,Birth Date1,Birth Place1,Death Date1,Death Place1,Given2,Surname2,Birth Date2,Birth Place2,Death Date2,Death Place2"); swsn = new StreamWriter(args[1] + "\\surname.csv",false); string[] files = Directory.GetFiles(args[1], "*.*", SearchOption.TopDirectoryOnly); string[] files2 = Directory.GetFiles(args[1], "*.*", SearchOption.TopDirectoryOnly); if (args.Length >= 3 && args[2].Equals("-file")) { files = new string[1]; files[0] = args[3]; } if (args.Length >= 3 && args[2].Equals("-dir")) { files2 = Directory.GetFiles(args[3], "*.*", SearchOption.TopDirectoryOnly); } foreach (string gdf1 in files) { string gedcomFile1 = gdf1.ToUpper(); if (!gedcomFile1.EndsWith(".GED")) continue; swFile1 = Path.GetFileName(gedcomFile1); //Console.WriteLine("Loading " + ); GedcomParser.GedcomRecordReader grr1 = new GedcomParser.GedcomRecordReader(); grr1.GedcomFile = gedcomFile1; try { grr1.ReadGedcom(); } catch { continue; } GedcomDatabase gd1 = grr1.Database; System.Collections.Generic.List<string> sv = new System.Collections.Generic.List<string>(); foreach (GedcomIndividualRecord rec in gd1.Individuals) { try { foreach (GedcomName sname in rec.Names) { if (!sv.Contains(sname.Surname.ToUpper())) { sv.Add(sname.Surname.ToUpper()); swsn.WriteLine(gedcomFile1 + ",\"" + sname.Surname.ToUpper().Replace("\"","_") + "\""); } } } catch { Console.WriteLine("Can't read"); } } foreach (string gdf2 in files2) { string gedcomFile2 = gdf2.ToUpper(); if (!gedcomFile2.EndsWith(".GED")) continue; if (gedcomFile2.Equals(gedcomFile1)) continue; swFile2 = Path.GetFileName(gedcomFile2); //Console.WriteLine("Comparing " + gedcomFile1 + " and " + gedcomFile2); GedcomParser.GedcomRecordReader grr2 = new GedcomParser.GedcomRecordReader(); grr2.GedcomFile = gedcomFile2; try { grr2.ReadGedcom(); } catch { continue; } GedcomDatabase gd2 = grr2.Database; GedcomDuplicate.DuplicateFoundFunc found = new GedcomDuplicate.DuplicateFoundFunc(FoundDuplicate); float matchThreshold = 95; GedcomDuplicate.FindDuplicates(gd1, gd2, matchThreshold, found); } sw.Flush(); swsn.Flush(); } sw.Close(); swsn.Close(); } if (args.Length >= 2 && args[0].Equals("-surname")) { string[] files = Directory.GetFiles(args[1], "*.*", SearchOption.AllDirectories); string surname = args[2].ToUpper(); foreach (string gedcomFile1 in files) { if (!gedcomFile1.ToUpper().EndsWith(".GED")) continue; //Console.WriteLine("Comparing " + gedcomFile1 + " for surname " + surname); GedcomParser.GedcomRecordReader grr1 = new GedcomParser.GedcomRecordReader(); try { grr1.GedcomFile = gedcomFile1; grr1.ReadGedcom(); GedcomDatabase gd1 = grr1.Database; bool foundfile = false; foreach (GedcomIndividualRecord rec in gd1.Individuals) { try { if (rec.Names.Count > 0 && rec.Names[0].Surname.ToUpper().Equals(surname)) { if (!foundfile) { Console.WriteLine("File " + gedcomFile1); foundfile = true; } Console.Write(" Found " + rec.Names[0].Given + " " + rec.Names[0].Surname); try { Console.Write(" Born: " + rec.Birth.Date.DateString); } catch { } try { Console.Write(" in " + rec.Birth.Place.Name); } catch { } try { Console.Write(" Died: " + rec.Death.Date.DateString); } catch { } try { Console.Write(" at " + rec.Death.Place.Name); } catch { } Console.WriteLine(); } } catch { Console.WriteLine("Can't read"); } } } catch { } } } if (args.Length >= 2 && args[0].Equals("-surfile")) { List<string> lstSurname = new List<string>(); string[] files = Directory.GetFiles(args[1], "*.*", SearchOption.TopDirectoryOnly); //string surname = args[2].ToUpper(); foreach (string gedcomFile1 in files) { if (!gedcomFile1.ToUpper().EndsWith(".GED")) continue; //Console.WriteLine("Comparing " + gedcomFile1 + " for surname " + surname); GedcomParser.GedcomRecordReader grr1 = new GedcomParser.GedcomRecordReader(); try { grr1.GedcomFile = gedcomFile1; grr1.ReadGedcom(); GedcomDatabase gd1 = grr1.Database; bool foundfile = false; if (!Directory.Exists(args[1] + "\\Surname")) Directory.CreateDirectory(args[1] + "\\Surname"); foreach (GedcomIndividualRecord rec in gd1.Individuals) { try { StreamWriter sw; if (rec.Names.Count > 0) { string surname = rec.Names[0].Surname.Replace("(", "").Replace(")", "").Replace("_", "").Replace("?", "").Replace("[", "").Replace("]", "").Replace("\'", "").Replace("\\", "").Replace("/", ""); if (!lstSurname.Contains(surname)) { sw = new StreamWriter(args[1] + "\\Surname\\Surname_" + surname + ".csv", false); sw.WriteLine("File,Given,Surname,Birth Date,Birth Place,Death Date,Death Place"); lstSurname.Add(surname); } else sw = new StreamWriter(args[1] + "\\Surname\\Surname_" + surname + ".csv", true); sw.Write("\"" + gedcomFile1 + "\"," + "\"" + rec.Names[0].Given + "\"," + "\"" + rec.Names[0].Surname + "\","); try { sw.Write("\"" + rec.Birth.Date.DateString + "\"," + "\"" + rec.Birth.Place.Name + "\","); } catch { sw.Write(",,"); } try { sw.WriteLine( "\"" + rec.Death.Date.DateString + "\"," + "\"" + rec.Death.Place.Name + "\"");} catch { sw.WriteLine(","); } sw.Close(); } } catch (Exception ex) { Console.WriteLine("Can't read: " + ex.Message + "-" + ex.StackTrace); } finally { if (sw != null) sw.Close(); } } } catch { } } } if (args.Length >= 2 && args[0].Equals("-birth")) { string[] files = Directory.GetFiles(args[1], "*.*", SearchOption.AllDirectories); string surname = args[2].ToUpper(); foreach (string gedcomFile1 in files) { if (!gedcomFile1.ToUpper().EndsWith(".GED")) continue; //Console.WriteLine("Comparing " + gedcomFile1 + " for surname " + surname); GedcomParser.GedcomRecordReader grr1 = new GedcomParser.GedcomRecordReader(); grr1.GedcomFile = gedcomFile1; grr1.ReadGedcom(); GedcomDatabase gd1 = grr1.Database; bool foundfile = false; foreach (GedcomIndividualRecord rec in gd1.Individuals) { try { if (rec.Birth != null && rec.Birth.Place != null && rec.Birth.Place.Name != null && rec.Birth.Place.Name.ToUpper().Contains(surname)) { if (!foundfile) { Console.WriteLine("File " + gedcomFile1); foundfile = true; } Console.Write(" Found " + rec.Names[0].Given + " " + rec.Names[0].Surname); try { Console.Write(" Born: " + rec.Birth.Date.DateString); } catch { } try { Console.Write(" in " + rec.Birth.Place.Name); } catch { } try { Console.Write(" Died: " + rec.Death.Date.DateString); } catch { } try { Console.Write(" at " + rec.Death.Place.Name); } catch { } Console.WriteLine(); } } catch (Exception ex) { Console.WriteLine("Can't read:" + ex.Message + " : " + ex.StackTrace); } } } } if (args.Length >= 2 && args[0].Equals("-soundex")) { string[] files = Directory.GetFiles(args[1], "*.*", SearchOption.AllDirectories); string surname = args[2].ToUpper(); string sunameSoundex = Util.GenerateSoundex(surname); foreach (string gedcomFile1 in files) { if (!gedcomFile1.ToUpper().EndsWith(".GED")) continue; //Console.WriteLine("Comparing " + gedcomFile1 + " for surname " + surname); GedcomParser.GedcomRecordReader grr1 = new GedcomParser.GedcomRecordReader(); grr1.GedcomFile = gedcomFile1; grr1.ReadGedcom(); GedcomDatabase gd1 = grr1.Database; bool foundfile = false; foreach (GedcomIndividualRecord rec in gd1.Individuals) { if (rec.Names[0].SurnameSoundex.Equals(sunameSoundex)) { if (!foundfile) { Console.WriteLine("File " + gedcomFile1); foundfile = true; } Console.Write(" Found " + rec.Names[0].Given + " " + rec.Names[0].Surname); try { Console.Write(" Born: " + rec.Birth.Date.DateString); } catch { } try { Console.Write(" in " + rec.Birth.Place.Name); } catch { } try { Console.Write(" Died: " + rec.Death.Date.DateString); } catch { } try { Console.Write(" at " + rec.Death.Place.Name); } catch { } Console.WriteLine(); } } } } if (args.Length >= 2 && args[0].Equals("-loaddir")) { string[] files = Directory.GetFiles(args[1], "*.*", SearchOption.AllDirectories); foreach (string gedcomFile1 in files) { Console.WriteLine("Loading " + gedcomFile1); GedcomParser.GedcomRecordReader grr1 = new GedcomParser.GedcomRecordReader(); grr1.GedcomFile = gedcomFile1; grr1.ReadGedcom(); GedcomDatabase gd1 = grr1.Database; foreach (GedcomIndividualRecord matchIndi in gd1.Individuals) { SaveDatabase(matchIndi); } } } if (args.Length >= 2 && args[0].ToUpper().Equals("-GEDMATCH")) { GedMatch.GedMatch gm = new GedMatch.GedMatch(); gm.WorkDir = args[1]; gm.DoMatch = true; gm.DoGed = true; gm.loadGedMatch(args[2],true); } if (args.Length >= 2 && args[0].ToUpper().Equals("-GETGEDMATCH")) { GedMatch.GedMatch gm = new GedMatch.GedMatch(); gm.WorkDir = args[1]; gm.DoGed = true; gm.loadGedMatch(args[2], true); } }