不确定行数,中间有许多其他数据
A区:[666000887]
.....
B区:[666000667]
A区积分:5468148
...
B区积分:0
C区积分:0
想分别读出  B区     后面的数据   [666000667]
            B区积分 后面的数据   0
存入对应的不同字段很多文件,就前面有冒号隔开
怎么办??

解决方案 »

  1.   

    var
      F: TextFile;
      fn, lninfo: string;
      res,res1:string;
    begin
          fn:='*.Dat';
          AssignFile(F,fn);
          if FileExists(fn) 
          while not  eof(F) do
          begin
            Readln(F,lninfo);
            if (pos('B区',lbinfo)>0) then res:=copy(lbinfo,pos(':',lninfo)+1,length(lninfo));
            if (pos('B区积分',lbinfo)>0) then res:=copy(lbinfo,pos(':',lninfo)+1,length(lninfo));
          end;
          CloseFile(F);
        end;
        sleep(500);
      end;
    end;