SRL Archive - Other Scripts

Deleting Enters


Diabloizzle

2007-09-10 22:44:30

You know how lots of programs can't read enters in a txt. file? Well, if you have an extremely long file and do not want to write code to delete all the enters…I HAVE JUST THE THING FOR YOU!! this is very simple…however it is not perfect…use word pad and already have a scroll bar at the bottom.

NOTE: you may have to change colors or coordinates for the script to work. It is pretty simple, coodinates in findcolor are for the scroll bar(far left) and the only color is for the scroll bar. There is one other coordinate for the SECOND line of txt in your file…(h)

have fun! (dunno why you need it ;) )

danrox2004

2007-09-11 04:02:21

I think this will work too for text files:
program deleteEnters;

procedure deleteEnters(files: array of string);
var
i, j: integer;
s: string;
begin
for i := 0 to length(files) - 1 do
begin
j := openFile(files[i], False);
readFileString(j, s, fileSize(j));
s := replace(s, #13#10, '');
writeFileString(j, s);
closeFile(j);
end;
end;

begin
deleteEnters([appPath + 'my text.txt']);
end.

Diabloizzle

2007-09-11 21:26:15

Cool thanks! well that just completely owned my script. Oh well, it was kind of rough anyway, i just used it to quickly get rid of the enters. Just thought I'd, release it into the wild! :P