Hi!
I just wanna to delete from specified text file first N characters, but i'm stuck. Help me please!
procedure HeadCrop(const AFileName: string; const AHowMuch: Integer);
var
F: TextFile;
begin
AssignFile(F, AFileName);
// what me to do next?
// ...
// if AHowMuch = 3 and file contains"Hello!" after all statements
// it must contain "lo!"
// ...
CloseFile(F);
end;
I'm tried to use TStringList but its additionally appends end-line character!
with TStringList.Create do
try
LoadFormFile(AFileName); // before - "Hello!"
// even there are no changes...
SaveToFile(AFileName); // after - "Hello!#13#10"
finally
Free;
end;
Thanks!