Autor Beitrag
Biarchiv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Do 15.01.04 20:39 
Hallo,

Wie kann ich jede einzelne Zeile in einer Textdatei in einen Integer oder String
geben?

Datei.txt
Alles
Gute
kommt

Diese drei Zeilen in Integer oder String.

Danke

Moderiert von user profile iconDeCodeGuru: Topic verschoben
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: Do 15.01.04 20:46 
Benutz doch einfach eine Stringlist. Da kannst du einfach eine Textdatei laden und zeilenweise auf den Inhalt zugreifen. Aber mal ne andere Frage: Wie willst du denn ein Wort wie "Alles" in einen Integer "geben"??? :wink:

_________________
Viele Grüße
Jakob
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Do 15.01.04 20:55 
Wenn du ausschließlich sequentiell drauf zugreifen willst, kannst du auch ReadLN benutzen, das liest jeweils eine Zeile und vergrößert den Filepointer um die Länge der Zeile. Nach jedem Aufruf kriegst du also die nächste Zeile und wanderst so durch die Datei.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert