AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

replace string in text files

Ein Thema von direktor · begonnen am 17. Jan 2020 · letzter Beitrag vom 21. Jan 2020
Antwort Antwort
direktor

Registriert seit: 5. Apr 2014
22 Beiträge
 
#1

AW: replace string in text files

  Alt 18. Jan 2020, 05:55
Dalai text is different every time so I can't use stringreplace function. I was thinking of creating 2 TStringLists and put together the whole file 1. copy up from header + 2. header replacement + 3. copy rest of file... Dennis thanks, long solution but I'll try. Uwe - Sie sind genial! Thank you all.
  Mit Zitat antworten Zitat
Benutzerbild von Dalai
Dalai

Registriert seit: 9. Apr 2006
1.684 Beiträge
 
Delphi 5 Professional
 
#2

AW: replace string in text files

  Alt 18. Jan 2020, 13:49
Dalai text is different every time so I can't use stringreplace function.
See my EDIT. StringReplace can be used after determining the tags' offsets and getting the text via Copy function (using the previously determined offsets).

Regards
Dalai
  Mit Zitat antworten Zitat
direktor

Registriert seit: 5. Apr 2014
22 Beiträge
 
#3

AW: replace string in text files

  Alt 18. Jan 2020, 19:57
I have another problem, how to pass the Space in string?

For example I want to find string 'this is just a test' and replace it with 'this is not a test'. Problem is Delphi will find only first word 'this' - everything after space is ignored. How do I make it find full string not that it stops at space? Or I'm using Delphi version which is too low? Should I use Unicode string compare?

'this is something else' - delphi will find stop here because 'this' is contained here
'this is just a test' - but I want to change this line of text

How to do?
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#4

AW: replace string in text files

  Alt 18. Jan 2020, 20:16
Please open a new topic for a new problem. Thank you.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
TurboMagic

Registriert seit: 28. Feb 2016
Ort: Nordost Baden-Württemberg
3.047 Beiträge
 
Delphi 12 Athens
 
#5

AW: replace string in text files

  Alt 20. Jan 2020, 21:00
Another question: why so people write in English in German
Delphi-Praxis Forum eben there is an english one available nie?
  Mit Zitat antworten Zitat
Benutzerbild von p80286
p80286

Registriert seit: 28. Apr 2008
Ort: Stolberg (Rhl)
6.659 Beiträge
 
FreePascal / Lazarus
 
#6

AW: replace string in text files

  Alt 20. Jan 2020, 22:39
Es könnte sein, daß sie einfach höflich sind und nicht platt auf die englische Version verweisen.

Gruß
K-H
Programme gehorchen nicht Deinen Absichten sondern Deinen Anweisungen
R.E.D retired error detector
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#7

AW: replace string in text files

  Alt 21. Jan 2020, 00:50
Weil das Englisch des Fragestellers wohl besser ist als sein Deutsch und er die englische nicht kennt. Aber du solltest besser bei deutsch bleiben.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:40 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz