Autor Beitrag
Gigant02
Hält's aus hier
Beiträge: 9

win98/win2000/linux
D6 Ent.
BeitragVerfasst: Mi 13.10.04 20:11 
Hallo

Ich habe eine Textdatei und wollte wissen wie ich herausfinden kann wie viel Zeilen ich habe

Wie mache ich das am besten ???


und wie kann ich dann bestimmte zeilen ganz in einen string einlesen????

Lg, Ciam
sourcehunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 482

Win XP | Suse 10.1
Delphi 2005 Pers.
BeitragVerfasst: Mi 13.10.04 20:22 
Wenn du die Datei geöffnet hast, dann kannst du Zeilen mit ReadLn auslesen. Um zu Bestimmen, wie viele Zeilen in der Textdatei sind musst du einfach einen Zähler mitlaufenlassen, und die Datei bis zum EoF auslesen.

_________________
Linux und OpenSource rulez!
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 13.10.04 20:22 
Für dies Problem dürfte TStringList die beste Lösung sein. Mit LoadFromFile liest du die Text-Datei ein. Über Count stellst du die Anzahl der Strings fest. Und über Strings[x] greifst du auf die x-te Zeile zu.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mi 13.10.04 22:05 
Sorry, aber

HATTEN WIR ALLES SCHON MAL!!!

Leute, lest doch mal bitte FAQs oder nutzt die (endlich wieder) funktionierende Forensuche!

Danke.

P.S.: Setz deinen Post mal bitte noch auf Erledigt.

Moderiert von user profile iconChristian S.: Schriftgröße angepasst

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 13.10.04 22:18 
@BenBE: Beruhig Dich mal, ja!

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mi 13.10.04 22:44 
@TUFKAPL: Gerne doch, wenn dich das glücklich macht :D ... :mrgreen:

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Gigant02 Threadstarter
Hält's aus hier
Beiträge: 9

win98/win2000/linux
D6 Ent.
BeitragVerfasst: So 17.10.04 10:47 
hmm sorry

aber ich bin hier nicht so oft

gut nechstes mal werd ich mich dumm und doof suchen ok

_________________
ich lern das schon