Autor Beitrag
andre.maus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

winXP
Delphi 7
BeitragVerfasst: Mo 12.07.04 12:22 
Hallo Leute,

ich habe folgenden Text in einem Memo-Feld:
(ich benutze mal code-tags um das Memo Feld zu simulieren)


ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
Hans Wurst
Gertenstr. 6
11111 Wursthausen

12.07. 13:00 aaa
12.07. 13.15 bbb
12.07. 13.30 ccc
13.07. 14.45 ddd


nun will ich den als folgenden Text in eine Datei speichern (CSV):
(die Adressinformationen sollen dann nicht mehr da sein)

ausblenden Quelltext
1:
2:
3:
4:
5:
Datum,Uhrzeit,Typ
12.07.,13:00,aaa
12.07.,13.15,bbb
12.07.,13.30,ccc
13.07.,14.45,ddd


wie stelle ich das am Besten an?

Gruß,
Andre
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19341
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 12.07.04 12:48 
Entweder selbst programmieren mit Schleife fuer ersetzen der Leerzeichen oder so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
uses StrUtils;

var a: TStringList;
    i: Integer;
begin
    a:=TStringList.Create;
    for i:=4 to Memo1.Lines.Count-1 do
        a.Items.Add(AnsiReplaceStr(Memo1.Lines[i],' ',';'));
    a.SaveToFile(...);
    a.Free;
end;


Man ich hasse diese Sun Tastaturen, da dauerts ja ewig bis man was findet...
andre.maus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

winXP
Delphi 7
BeitragVerfasst: Mo 12.07.04 12:55 
Super!

Vielen Dank!


Gruß,
Andre
andre.maus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

winXP
Delphi 7
BeitragVerfasst: Mo 12.07.04 13:47 
Super!

Vielen Dank!


Gruß,
Andre