|I guess the first question is "In what application are you working?"|
With that asked...
I'm confused. I can't tell what is correct and what's a typo so I don't want to get too far into this until I understand what you are after.
Let's start simple:
One of your 2 original strings is this:
<Item ItemId="22" name="Output">
Your replacement string begins with this:
<ItemId"22" cancel="true" name"Output"...
That not only has addtional text (cancel="true") it's also missing some things that were in the original string. The equal signs are missing and the first word (Item) is missing.
You said you wanted to add text but you didn't say anything about changing any of the existing text.
Could you clarify that?
Next, your "From this" contain 2 strings, yet your "To this" only contains 1. What happened to "<market>1000006</market>"?
Next, "(the numbers are diffrent in each line)"
Where will these numbers come from? Maybe the better question is "Where will any of the "additional" text come from?
As you can tell from my questions, we need a lot more information before we can offer any help.
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.