Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mo 18.02.08 19:34 
Hi, Delpher,

mit welchem Befehl erhalte ich aus dem Dateinamen <Einrichtung.dbf> der natürlich ein Table1.tablename ist, den benötigten Dateinamen <Einrichtung> ? An diesen hänge ich dann noch '.txt' an, aber das ist ja nun kein Problem.

Danke für Hilfe,
Detlef A.
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mo 18.02.08 19:48 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var
s, d: String;
begin
d := 'C:\test.txt';
s := Copy(ExtractFileName(d), 0, pos('.dbf', ExtractFileName(d) - 1);
ShowMessage(s);
Fabian E.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 554

Windows 7 Ultimate
Visual Studio 2008 Pro, Visual Studion 2010 Ultimate
BeitragVerfasst: Mo 18.02.08 19:49 
also wenn du die dateiendung verändern willst schau dir mal ChangeFileExt an.

gruß
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mo 18.02.08 21:16 
user profile iconAndreas L. hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var
s, d: String;
begin
d := 'C:test.txt';
s := Copy(ExtractFileName(d), 0, pos('.dbf', ExtractFileName(d) - 1);
ShowMessage(s);


Wie wäre es denn mit ExtractFileExt.

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mo 18.02.08 21:36 
Danke, ihr (glorreichen) drei!

Gelöst!
Detlef