I have a code like this:

```
Kuu(ij,mn)=-H1/A1/AA2*R0(ij,mn)*DA1Y*DQ66Y+...
H1/A1/AAA2*R0(ij,mn)*Q66*DA1Y*DA2Y-...
1/H1/AA1/AA2*H2*R0(ij,mn)*Q66*DA1Y^2+...
1/AA1/H1*DH2X*Q11*RX(ij,mn)-...
1/AAA1*H2/H1*Q11*RX(ij,mn)*DA1X+...
1/H1/AA1/A2*H2*Q11*RX(ij,mn)*DA2X;
```

I want to move "H1" to the end of line. so it will become like this:

```
Kuu(ij,mn)=-1/A1/AA2*R0(ij,mn)*DA1Y*DQ66Y+...H1
1/A1/AAA2*R0(ij,mn)*Q66*DA1Y*DA2Y-...H1
1//AA1/AA2*H2*R0(ij,mn)*Q66*DA1Y^2+...H1
1/AA1/*DH2X*Q11*RX(ij,mn)-...H1
1/AAA1*H2/*Q11*RX(ij,mn)*DA1X+...H1
1//AA1/A2*H2*Q11*RX(ij,mn)*DA2X;H1
```

movingthe word “H1”, you’re moving the “H” and copying the “1”. And what do you want to happen to a line that doesn’t contain “H1”? or that contains it multiple times? – G-Man May 15 '17 at 3:26