Autor Beitrag
Cix6
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 60

Windows XP
Delphi 4 Standard, Delphi 7 PE, Delphi 2005 PE
BeitragVerfasst: Do 02.02.06 21:04 
hi,


ich habe nen file mit ganz viel text. darin könnten ein paar e-mail adressen stehen...

weiß jemand wie ich die am besten parsen könnte?

cix6
Cix6 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 60

Windows XP
Delphi 4 Standard, Delphi 7 PE, Delphi 2005 PE
BeitragVerfasst: Do 02.02.06 21:45 
hab jetzt folgendes getestet...das klappt aber nicht wirklich!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
procedure TForm1.Button1Click(Sender: TObject);
var
temp : string;
x,y,start,ende: integer;
begin
temp := http.Get('http://www.delphi-forum.de/');
if pos('@',temp) > 0 then
  begin
  y := pos('@',temp);
  for x:= 0 to 60 do
    begin
    if (temp[y-x] = '"') or (temp[y-x] = '=') or (temp[y-x] = ':') then
      begin
      start := y-x;
      end;
    end;
  for x:= 0 to 60 do
    begin
    if (temp[y+x] = '"') or (temp[y+x] = '>') then
      begin
      ende := y+x;
      end;
    end;
    ShowMessage(inttostr(y) + '/' + inttostr(start) + '/' +inttostr(ende));
ShowMessage(copy(temp,start,ende-start));
  end;

end;


er gibt zu viel aus!
LLCoolDave
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 212

Win XP
Delphi 2005
BeitragVerfasst: Do 02.02.06 22:00 
mach mal nach dem start := y-x; und ende := y+x; jeweils noch ein break; damit er dort mit der Schleife aufhört, das sollte helfen.
Cix6 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 60

Windows XP
Delphi 4 Standard, Delphi 7 PE, Delphi 2005 PE
BeitragVerfasst: Do 02.02.06 22:25 
ok, danke, jetzt gehts!