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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| procedure TFrm2.Button1Click(Sender: TObject);
var S:string;
fic1,fic2:TextFile;
//Extension:string;
//ExtPart : TFileName;
i,j,p:integer;
F: TextFile;
L, IMSI,MSISDN: string;
PosEqual, PosComma, PosSUD: Integer;
begin
if OpenDialog1.Execute then
begin
OpenDialog1.Title:='Parcurir le dossier des fichiers';
AssignFile(F,OpenDialog1.FileName);
// Reset(fic1);
if savedialog1.execute then
AssignFile(fic2,savedialog1.filename+'.txt');
Rewrite(fic2);
writeln(fic2,'IMSI|','MSISDN|','CAT|','TS11|','TS21|','TS22|','TS62|','CFB|','CFU|','CFNRY|','CFNRC|','BAOC|','BOIC|','CAW');
try
Reset(F);
while not EOF(F) do
begin
ReadLn(F, L);
if Copy(L, 1, 10) = 'HGSUI:IMSI' then
begin
// Extraire le IMSI
PosEqual := Pos('=', L);
PosComma := Pos(',', L);
IMSI := Copy(L, PosEqual + 1, PosComma - PosEqual - 1);
//Memo1.Lines.Add('IMSI=' + IMSI);
end
//edit1.Text:=Copy(L, 1, 12);
else
if Copy(L, 1, 12) = 'HGSUI:MSISDN' then
begin
// Extraire le MSISDN
PosEqual := Pos('=', L);
PosComma := Pos(';', L);
MSISDN := Copy(L, PosEqual + 1, PosComma - PosEqual - 1);
edit2.Text:=MSISDN;
Memo1.Lines.Add('MSISDN=' + MSISDN);
end;
if (L <> '') then
begin
PosSUD := Pos('SUD=', L);
if PosSUD > 0 then
Memo1.Lines.Add((IMSI+'|'+MSISDN+'|'+PerformLine(Copy(L, PosSUD + 4, MAXINT))));
writeln(fic2,IMSI+'|',MSISDN,PerformLine(Copy(L, PosSUD + 4, MAXINT)));
end;
end;
finally
CloseFile(F);
end;
end;
end; |
Partager