|
TStringList *ab= new TStringList() ;
TStringList *a = new TStringList() ;
TStringList *b = new TStringList() ;
ab->LoadFromFile("ab.txt") ;
for(int i=0 ;i<ab->Count/2;i++) a->Add(ab->operator [](i)) ;
for(int i= ab->Count/2 ; i< ab->Count ; i++) b->Add(ab->operator [](i)) ;
a->SaveToFile("a.txt") ;
b->SaveToFile("b.txt") ;
delete temp ;
delete a ;
delete b ;
|