Sunday, 25 August 2013

Inno Setup: Delete empty lines from test file

Inno Setup: Delete empty lines from test file

We are using below code to delete empty lines from text file, But it's not
working.
function UpdatePatchLogFileEntries : Boolean;
var
a_strTextfile : TArrayOfString;
iLineCounter : Integer;
ConfFile : String;
begin
ConfFile := ExpandConstant('{sd}\patch.log');
LoadStringsFromFile(ConfFile, a_strTextfile);
for iLineCounter := 0 to GetArrayLength(a_strTextfile)-1 do
begin
if (Pos('', a_strTextfile[iLineCounter]) > 0) then
Delete(a_strTextfile[iLineCounter],1,1);
end;
SaveStringsToFile(ConfFile, a_strTextfile, False);
end;
Please help me. Thanks in Advance.

No comments:

Post a Comment