If I understood you correctly then you need to to first transfer the data to an array using the code

Dim Lines() As String = Split(TextBox1.Text, vbCrLf)

Then Sort the array and then replace duplicate values. If you want to replace only "12JAMAL" then you don't need to sort. Simply loop thru the array and find a second occurance of "12JAMAL" and delete it.

After you are done, transfer the data back to textbox....

Hope this helps...