ok so basically I am writing a small program that does a few different things in Delphi 2007. I am very new to coding and so I hope that my terminology will be up to par. If not, please forgive me.
I am loading text files into a ListView... I know arrays can do this much faster, but I am trying to do this in a more visual way. When I load a list of oh, say 15,000 lines... I would like to be able to split the list and then save them into smaller lists. I have an editbox to display how many lines to use for splitting..
For example: I want to split the 15,000 line text file into 250 lines.. or maybe 3,000 lines. I cant for the life of me figure out how to do this.
Once the files are split, then naturally they need to be saved as well.. and that is the other problem.
ANY help on this would be a huge relief!
My code is as follows and is horribly wrong i am WELL aware:
procedure TForm1.Button12Click(Sender: TObject);
var
txt : textfile;
x,y : integer;
begin
savedialog1.Execute();
AssignFile(txt, saveDialog1.FileName + '.txt');
ReWrite(txt);
for x := 0 to ListView1.Items.Count - 1 do
begin
Writeln(txt, ListView1.Items[x].Caption, edit6.text);
end;
end;
As you can see, this is extremely fouled up and I have been trying for hours to figure this out. Thanks for any help in advance. :)