private Projekt ParseProjekt(Projekt P, String[] Split) { if (P == null) { P = new Projekt(); P.ProjectName = Split[PROJECT]; ParseSamplePhase(null, Split); } else { if (P.ProjectName == Split[PROJECT]) { SamplePhase phase; if (P.SamplePhaseList.TryGetValue(Split[SAMPLEPHASE], out phase)) { //SamplePhase existiert schon ParseSamplePhase(phase, Split); } else { //neue SamplePhase phase = ParseSamplePhase(null, Split); P.SamplePhaseList.Add(Split[SAMPLEPHASE], phase); } } } return(P); }
public void Read(String Filename) { Projekt p = null; try { // Open the text file using a stream reader. using (StreamReader sr = new StreamReader(Filename)) { String line = null; while ((line = sr.ReadLine()) != null) { String[] split = line.Split('\t'); if (split.Count() >= 5) { ParseProjekt(p, split); } } } } catch (Exception e) { Console.WriteLine("The file could not be read:"); Console.WriteLine(e.Message); } }