Hello, @darklinkpower,
I was away from the N++ community, since more than a month ( see my post below )
https://community.notepad-plus-plus.org/post/47895
So, @darklinkpower, my reply is quite out of date. But if you still look for a regex solution I can take up the challenge of performing this S/R with regexes !
However you must give me a real example of your 2 ( short ) files A and B, as well as the expected real output file, from these 2 input files
Simply, as your files are XML ones, in your future post, write your code in blocks, like below :
~~~xml
…
…
~~~
Just to give you an idea, of the regexes’s powerful, let’s suppose the input text, below :
<text><![line a[line b, line c, line d, A1, A2, A3]]></text> <text><![line a[line b, line c, line d, B1, B2, B3]]></text> <text><![line a[line b, line c, line d, line e, line f, line g, line h, C1, C2, C3, C4]]></text> <text><![line a[line b, line c, line d, line e, line f, line g, line h, D1, D2, D3, D4]]></text> <text><![line a[Small test, E1, E2, E3, E4, E5, E6, E7, E8, E9]]></text> <text><![line a[Small test, F1, F2, F3, F4, F5, F6, F7, F8, F9]]></text> <text><![line a[word 1, G1, G2]]></text> <text><![line a[word 1, H1, H2]]></text> <text><![line a[I1]]></text> <text><![line a[J1]]></text>Then, the following regex S/R :
SEARCH (?-s)^(.+)(.+)\]\]></text>(\R)\1(.+)\R
REPLACE \1\2, \4\3
will change, when you click on the Replace All button, in one go, the text as below :
<text><![line a[line b, line c, line d, A1, A2, A3, B1, B2, B3]]></text> <text><![line a[line b, line c, line d, line e, line f, line g, line h, C1, C2, C3, C4, D1, D2, D3, D4]]></text> <text><![line a[Small test, E1, E2, E3, E4, E5, E6, E7, E8, E9, F1, F2, F3, F4, F5, F6, F7, F8, F9]]></text> <text><![line a[word 1, G1, G2, H1, H2]]></text> <text><![line a[I1, J1]]></text>As you can see, this regex S/R is able to differentiate the first common part of two consecutive lines from the second variable part which must be merged in one line only ;-))
So, see you later !
Best Regards,
guy038