Open "location.txt" For Output As #1
Do Until EOF(1)
Line Input #1, iString
arr = Split(iString,vbtab)
str1 = arr(0)
str2 = arr(1)
if str2="团结公司" then
str1="王五"
print #1,str1&vbtab&str2
end if
Loop
var
SL: TStringlist;
lp: integer;
begin
SL := TStringlist.create;
sl.loadfromfile('d:\aa.txet');
for lp := 0 to sl.count - 1 do
begin
if Pos(' 团结公司', sl[lp]) > 0 then
begin
sl[lp] := '王五 ' + '团结公司'';
break;
end;
end;
sl.savetofile('d:\aa.txet');
Sl.free;
end;