Autor Beitrag
Hagbard
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 142

Win XP Home / Pro
D7.1 Architekt
BeitragVerfasst: Mi 16.06.04 11:43 
Hallo zusammen,

Ich habe eine Datei, die in etwa so aussieht...:

ausblenden Quelltext
1:
2:
3:
<RC120,050><LT2><BX130,740>
<RC165,200><X2><EP3>{MEMBERNO}<NR>
<p>


Ich lese mir jetzt jede Zeile einzeln ein (in eine TStringList).

Jetzt möchte Ich Teile aus einer Zeile austauschen (z.B. "{MEMBERNO}" durch etwas anderes ersetzen, wobei das, was anstatt "{MEMBERNO}" rein soll kürzer oder länger sein kann.

Hat jemand ein Tip für mich wie man sowas machen kann? Oder evt. sogar nen CodeSchnipsel?

Viele Grüße,
Christian

_________________
I haven't failed, I just found 10,000 ways that won't work!
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 16.06.04 11:52 
Nun ja, ich weiß nicht, ob es die Unit StrUtils auch für Kylix gibt, aber wenn ja, findest Du dort unter anderem AnsiReplaceString.

Sonst müsstest du das halt selber lösen:
Mit Pos die Position des Textes herausfinden, alles bis dahin in einen String kopieren, dann deinen String einfügen und dann den Rest (Länge - Pos - Länge des gesuchten) dazukopieren. Dann noch String zurückschreiben. (Das geht auch ohne temporären String, ist aber etwas :lol: unübersichtlich...)
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Mi 16.06.04 12:15 
Wer redet denn von kylix? seh nur D7 archi in dem profil!?

Die funktion stringReplace sollte es aber auch tun!

_________________
mfg.
mâximôv
Hagbard Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 142

Win XP Home / Pro
D7.1 Architekt
BeitragVerfasst: Mi 16.06.04 12:19 
Vielen Dank Euch 2 :)

_________________
I haven't failed, I just found 10,000 ways that won't work!
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 16.06.04 12:27 
@maximus: Threads verwechselt... :oops: