internal bool ReadFromFile() { string FileName = MForm.GetDataDirectory() + "Parcels.csv"; // ECTime RecTime = new ECTime(); try { string Line; using( StreamReader SReader = new StreamReader( FileName )) { int HowMany = 0; while( SReader.Peek() >= 0 ) { Line = SReader.ReadLine(); if( Line == null ) continue; // Keep the tabs here. // Line = Line.Trim(); if( Line.Length < 3 ) continue; if( Line.StartsWith( "APN,C,12\tOWNER,C,50\t" )) continue; if( !Line.Contains( "\t" )) continue; LaPlataRecord Rec = new LaPlataRecord( MForm ); if( !Rec.StringToObject( Line )) continue; if( !AddLaPlataRec( Rec )) break; // Out of RAM. HowMany++; } MForm.ShowStatus( " " ); MForm.ShowStatus( "Records: " + HowMany.ToString( "N0" )); } // Don't sort the whole thing. At least not with a bubble sort. // Sort a small subset of results. // SortByName(); return true; } catch( Exception Except ) { MForm.ShowStatus( "Could not read the La Plata data file." ); MForm.ShowStatus( Except.Message ); return false; } }