procedure TForm1.Button2Click(Sender: TObject);
var
i,iCount,iPos:integer ;
txtFile :TStringList ;
sFields :array of string ;
sSfzhm ,sName,tepStr :String ;
begin
txtFile :=TStringList.Create ;
txtFile.LoadFromFile ('d:/Demo.txt');
//tepStr :=txtFile.Strings[0];
For iCount := 1 to txtFile.Count -1 do
begin
tepStr := txtFile.Strings [iCount ] ;
iPos := Pos ('|',tepStr);
sName := Copy (tepStr,1,iPos-1) ;
tepStr:= Copy (tepStr,iPos+1,Length (tepStr));
iPos := Pos ('|',tepStr);
sSfzhm := Copy (tepStr,1,iPos-1) ;
if table1.Locate ('sfzhm',sSfzhm,[]) then
begin
table1.edit ;
Table1.FieldByName('XX').AsString :=Table1.FieldByName('XX').AsString +'1';
table1.post ;
end ;
end ;
end;