Artificial intelligent assistant

How to transform a matrix $A$ such that it has all its entries similar to an another matrix $B$ except its last row? I have two matrices $A$ and $B$. I am looking for a transformation $TAT^{-1}$ such that all the entries of $TAT^{-1}$ are same as of $B$ except its last row so that I can get a matrix which contains all elements zero except its last row when I subtract $B$ from $TAT^{-1}$. Is there any idea?

Let ${\mathbb M}_n$ be the space of all $n\times n$ matrices. For $i, j\in \\{ 1, \ldots, n\\}$, let $E_{ij}\in {\mathbb M}_n$ be the matrix with $1$ at the position $(i,j)$ and with $0$ in the other positions (the standard basis for ${\mathbb M}_n$). Denote by $orb(A)$ the symmilarity orbit of $A\in {\mathbb M}_n$, i.e., $$ orb(A)=\\{ TAT^{-1};\quad T\in {\mathbb M}_n\quad \text{invertible}\\} $$ and let $$ {\mathcal S}=\\{ a_1E_{n1}+\cdots+a_n E_{nn};\quad a_1, \ldots, a_n \in {\mathbb F}\\} $$ be the linear subspace of ${\mathbb M}_n$ of all matrices which have $0$ everywhere except in the last line. Then $A$ and $B$ can be connected in the prescribed way if and only if $B\in orb(A)+{\mathcal S}$. Of course, this is a trivial observation, however I guess that for a general $A$ it cannot be said much more.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy f59fa66f1db0f789fa84eb8dfbf241eb