Autor Beitrag
tmkb
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 59



BeitragVerfasst: Mi 14.08.02 02:01 
Hallo,

wie kann ich bspw. in der zeile 5 der datei test.txt das zeichen 97 bis 109 in einen String laden?
thx
tmkb
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 14.08.02 08:08 
Hallo,

am einfachsten wird es wohl sein eine Stringlist zu benutzen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
Function GetString: String;
Var
  SL: tStringList;
Begin
  SL := tStringList.Create;
  SL.LoadFromFile ('c:\test.txt');
  
  If (Sl.Count > 4) and (Length (SL [4]) > 108) Then
    Result := Copy (SL [4], 97, 12)
  Else
    Result := '';
  
  SL.Free;
End;


Hoffe das hilft Dir!
Gruß
TINO

PS: Den Code habe ich nicht getestet!