我有一个文本文件大致内容如下:如何能定义从后往前搜索出带日期,时间的那两行字符那?然后取出其日期,时间,就是:2005-06-08 09:28:13   2005-06-08 09:31:38   保存成一个文件那?
不胜感激,小弟拜谢了,在线等。
full text indexing
> 2005-06-08 09:28:13   Periodic full text indexer terminating
> 2005-06-08 09:31:38   Running Program document for 'nserver -c "trace
hub_s/CMA"'
> trace hub_s/CMA
Determining path to server HUB_S/CMA
Enabled Ports:  TCPIP
Checking normal priority connection documents only...
本地网络  连接文档查找服务器 hub_s/CMA
   Connected to server HUB_S/CMA

解决方案 »

  1.   

    用两个Memo控件,Memo1放老文件,Memo2放新文件。
    var
      DPos1,Dpos2:Integer;
    begin
      Memo1.Lines.LoadFrom('老文件.txt');
      Dpos1:=Pos(Memo1.Lines.Text,'>',0);
      Memo2.Lines.Add(Midstr(Memo1.text,Dpos1+1,19);
      Dpos2:=Pos(Memo1.Lines.Text,'>',Dpos1+1);
      Memo2.Lines.Add(Midstr(Memo1.text,Dpos2+1,19);
      //-----存为文件---
      Memo2.Lines.Saveto('新文件.txt');
    end;
      

  2.   

    用KMP算法,进行字符串匹配呢。你可以试试
      

  3.   

    Dpos1:=Pos(Memo1.Lines.Text,'>',0);
     能通过编译?