Hope everyone does a great job. I have only one question, in Delphi programming ... I have a memo that downloads a .txt file and contains large lines, for example, 50,000 lines ....
SO I want to split them into 5000line and then load them into a new Memo. for example, for the first split, it will split 5000 lines into a new file, then load it into a new note after downloading (deleting the 5000 file), and, of course, for large LINES it will be 45000.
the second split will divide 5000 with 45 000, it will be 40 000 on large lines, 5000 on new lines (file text).
THE REASON, why I want to split the lines into the text of the file, and then load it, because the program does not respond (does not respond) when I separate files into a note.
procedure TForm1.Button1Click(Sender: TObject); var count,i ,X,m:integer; begin Memo2.Clear; Label1.Caption:=IntToStr(Memo1.Lines.Count) ; if Memo1.Lines.Count > 5000 then X:=5000 else X:= Memo1.Lines.Count ; for count:=0 to x do begin Memo2.lines.add(Memo1.lines.Strings[0]); Memo1.Lines.Delete(0); Memo2.Text:=Trim(Memo2.text); end; end;
This is the code that I use to split small lines into small other lines ...
In a note, but when you have 1 million lines, the program will stop responding.
I added cropping (memo2.text); To delete an empty line at the end.
So, how can I do line splitting, not from a SIZE file (because it will kill lines) ... how can I do big line splitting, as I said to the file, then load it and delete it, then when I press the button again, it will perform the same operation with other lines ....
I know that we should use the TThread class, but I do not know how this happened with my code ... Thank you!
Thanks.