Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
Untitled diff
作成日
9 年前
差分は期限切れになりません
クリア
エクスポート
共有
説明
30 削除
行
合計
削除
文字
合計
削除
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
39 行
すべてコピー
45 追加
行
合計
追加
文字
合計
追加
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
50 行
すべてコピー
function TTextTestImporter.ParseHeader(Lines: TStrings): Boolean;
function TTextTestImporter.ParseHeader(Lines: TStrings): Boolean;
var
var
コピー
コピー済み
コピー
コピー済み
i, Pos1, Pos2, Pos3, Pos4, Age: Integer
;
PatientFound, DateFound: Boolean
;
Line, PatientName
: String;
Line, PatientName
, AgeStr, BirthDateStr, DateStr
: String;
PatientRegex, DateRegex: TRegExpr;
i: Integer;
begin
begin
コピー
コピー済み
コピー
コピー済み
PatientRegex := TRegExpr.Create;
PatientRegex.Expression := 'Paciente\s+:*(.*)\s{2,}Idade:+(\d+)\s*anos\s*Nascimento:*(.+)';
PatientRegex.ModifierI := True;
PatientRegex.ModifierG := True;
DateRegex := TRegExpr.Create;
DateRegex.Expression := 'Data\s*de\s*Cadastro\.*\s*:*(.+)';
DateRegex.ModifierI := True;
DateRegex.ModifierG := True;
Result := False;
Result := False;
コピー
コピー済み
コピー
コピー済み
for i := 0 to Lines.Count -
1 do
PatientFound := False;
DateFound := False;
for i := 0 to Lines.Count -
1 do
begin
begin
コピー
コピー済み
コピー
コピー済み
if
Result
then
if
(DateFound and PatientFound) or (i > 20)
then
Exit
;
break
;
Line :=
UpperCase(
Trim(Lines[i])
)
;
Line :=
Trim(Lines[i])
;
if
AnsiStartsStr('PACIENTE',
Line) then
if
not PatientFound and PatientRegex.Exec(
Line) then
begin
begin
コピー
コピー済み
コピー
コピー済み
Pos1 := PosEx(':', Line, Length('PACIENTE') + 1);
PatientFound := True;
if Pos1 > 0 then
PatientName := Trim(PatientRegex.Match[1]);
begin
AgeStr := Trim(
Patient
Regex.Match[2]);
Pos2 := RPos('IDADE', Line);
BirthDateStr
:=
Trim(PatientRegex.Match[3]);
if Pos2 > 0 then
FData.Strings['name'] := PatientName;
begin
FData.Integers['age'] :=
StrToIntDef(
Age
Str, 0)
;
PatientName := Trim(Copy(Line, Pos1 + 1, Pos2 - Pos1 - 1));
FData.Floats['birthdate'] := ScanDateTime('dd/mm/yy', BirthDateStr)
;
if
Patient
Name <> '' then
continue;
begin
end;
Result
:=
True;
FData.Strings['name'] := PatientName;
if not DateFound and DateRegex.Exec(Line) then
Pos3 := PosEx(':', Line, Pos2);
begin
if Pos3 <> 0 then
DateFound := True;
begin
DateStr := Trim(DateRegex.Match[1]);
Pos4 := PosEx('ANOS', Line, Pos3);
FData.Floats['date'] := ScanDateTime('dd/mm/yyyy', DateStr)
;
if TryStrToInt(Trim(Copy(Line, Pos3 + 1, Pos4 - Pos3 - 1)), Age) then
FData.Integers['age'] :=
Age
;
end
;
end;
end;
end
;
end;
end;
end;
end;
コピー
コピー済み
コピー
コピー済み
Result := DateFound and PatientFound
and (FData.Get('name', '') <> '')
and (FData.Get('age', 0) <> 0)
and (FData.Get('birthdate', 0.0) <> 0)
and (FData.Get('date', 0.0) <> 0);
end;
end;
コピー
コピー済み
コピー
コピー済み
保存された差分
原文
ファイルを開く
function TTextTestImporter.ParseHeader(Lines: TStrings): Boolean; var i, Pos1, Pos2, Pos3, Pos4, Age: Integer; Line, PatientName: String; begin Result := False; for i := 0 to Lines.Count -1 do begin if Result then Exit; Line := UpperCase(Trim(Lines[i])); if AnsiStartsStr('PACIENTE', Line) then begin Pos1 := PosEx(':', Line, Length('PACIENTE') + 1); if Pos1 > 0 then begin Pos2 := RPos('IDADE', Line); if Pos2 > 0 then begin PatientName := Trim(Copy(Line, Pos1 + 1, Pos2 - Pos1 - 1)); if PatientName <> '' then begin Result := True; FData.Strings['name'] := PatientName; Pos3 := PosEx(':', Line, Pos2); if Pos3 <> 0 then begin Pos4 := PosEx('ANOS', Line, Pos3); if TryStrToInt(Trim(Copy(Line, Pos3 + 1, Pos4 - Pos3 - 1)), Age) then FData.Integers['age'] := Age; end; end; end; end; end; end; end;
変更されたテキスト
ファイルを開く
function TTextTestImporter.ParseHeader(Lines: TStrings): Boolean; var PatientFound, DateFound: Boolean; Line, PatientName, AgeStr, BirthDateStr, DateStr: String; PatientRegex, DateRegex: TRegExpr; i: Integer; begin PatientRegex := TRegExpr.Create; PatientRegex.Expression := 'Paciente\s+:*(.*)\s{2,}Idade:+(\d+)\s*anos\s*Nascimento:*(.+)'; PatientRegex.ModifierI := True; PatientRegex.ModifierG := True; DateRegex := TRegExpr.Create; DateRegex.Expression := 'Data\s*de\s*Cadastro\.*\s*:*(.+)'; DateRegex.ModifierI := True; DateRegex.ModifierG := True; Result := False; PatientFound := False; DateFound := False; for i := 0 to Lines.Count - 1 do begin if (DateFound and PatientFound) or (i > 20) then break; Line := Trim(Lines[i]); if not PatientFound and PatientRegex.Exec(Line) then begin PatientFound := True; PatientName := Trim(PatientRegex.Match[1]); AgeStr := Trim(PatientRegex.Match[2]); BirthDateStr := Trim(PatientRegex.Match[3]); FData.Strings['name'] := PatientName; FData.Integers['age'] := StrToIntDef(AgeStr, 0); FData.Floats['birthdate'] := ScanDateTime('dd/mm/yy', BirthDateStr); continue; end; if not DateFound and DateRegex.Exec(Line) then begin DateFound := True; DateStr := Trim(DateRegex.Match[1]); FData.Floats['date'] := ScanDateTime('dd/mm/yyyy', DateStr); end; end; Result := DateFound and PatientFound and (FData.Get('name', '') <> '') and (FData.Get('age', 0) <> 0) and (FData.Get('birthdate', 0.0) <> 0) and (FData.Get('date', 0.0) <> 0); end;
違いを見つける