Ver Mensaje Individual
  #7  
Antiguo 01-03-2012
Paulao Paulao is offline
Miembro
 
Registrado: sep 2003
Ubicación: Rua D 31 Casa 1 - Inhoaíba - Rio de Janeiro - RJ - Brasil
Posts: 637
Reputación: 21
Paulao Va por buen camino
Perdon, mi olvide de postar el codigo. Abajo el codigo.
Código Delphi [-]
function TForm1.TextFoundInFile(path: string; const FileMask:string; const tipo, tabela: string): TStrings;
var
  SR: TSearchRec;
  txt: TextFile;
  Row: string;
  Found: Boolean;
  i: Integer;
  NroExt: TStrings;
begin
  NroExt:= TStringList.Create;
  try
    NroExt.Delimiter:= ';';
    NroExt.DelimitedText:= FileMask;
    path := IncludeTrailingPathDelimiter(path);
    Result := TStringList.Create;
    for i:= 0 to NroExt.Count - 1 do
    begin
      if FindFirst(path + NroExt[i], faAnyFile - faDirectory, SR) = 0 then
        repeat
          AssignFile(txt,path + SR.Name);
          Reset(txt);
          Found:= False;
          while not Eof(txt) and not Found do
          begin
            Readln(txt, Row);
            if Pos(tabela, Row) > 0 then
            begin
              Application.ProcessMessages;
              Result.Add(tipo + ';' + tabela + ';' + SR.Name);
              //CheckListBox1.Items.Add(tipo + ' - ' + tabela + ' - ' + SR.Name);
              ListBox1.Items.Add(tipo + ' - ' + tabela + ' - ' + SR.Name);
              Found:= True
            end
          end;
          CloseFile(txt);
        until FindNext(SR) <> 0
    end
  finally
    NroExt.Free;
  end;
end;

y abajo la llamada a este metodo.
Código Delphi [-]
procedure TForm1.VarrerClick(Sender: TObject);
begin
  ClientDataSet1.Open;
  pth := IncludeTrailingPathDelimiter(edtDir.Directory);
  while not ClientDataSet1.Eof do
  begin
    //TextFoundInFile(pth,'*.pas;*.dfm',ClientDataSet1.FieldByName('xtype').AsString,ClientDataSet1.FieldB  yName('name').AsString).SaveToFile('D:\Teste\LISTA.txt');
    TextFoundInFile(pth,'*.pas;*.dfm',ClientDataSet1.FieldByName('xtype').AsString,ClientDataSet1.FieldB  yName('name').AsString);
    ClientDataSet1.Next;
  end;
end;
Responder Con Cita