I'm having trouble searching for strings in different memos and separating them. Let's go to the scene.
in Memo1 i have the following text
18049,25047,text4
18047,25046,text2
18048,25045,text3
18050,25048,text5
18046,25044,text1
and in Memo2
25049,9012646205,55315135004,adou4
25047,"",06252782912,textasidh
25046,"",44425660030,textblabla
25048,"",07649186806,textaldj
I need to separate the first digits up to the comma of memo2 and fetch into memo1 and add the complete lines. Memo1 + Memo2 in Memo3.
18046,25044,text1 25046,"",44425660030,textblabla
18047,25046,text2 25047,"",06252782912,textasidh
18048,25045,text3 25048,"",07649186806,textaldj
18049,25047,text4 25049,9012646205,55315135004,adou4
I've already tried using the function Split(Text, Delimitador: string): TSarray;
but without success
var
I, J: Byte;
Z : String;
begin
for I := 1 to 2 do
begin
for J := 0 to TMemo(FindComponent('Memo'+IntToStr(I))).Lines.Count -1 do
begin
Z := Memo2.Lines[J];
if Pos(Split(Z, ',')[0],TMemo(FindComponent('Memo'+IntToStr(I))).Lines[J]) > 0 then
Memo3.Lines.Add(TMemo(FindComponent('Memo'+IntToStr(I))).Lines[J]);
end;
end;
end;