If you don’t mind pushing this through multiple passes, I might suggest this:
Search:
^(Query=.*\n)((?:(?!Query=).*\n)+)\1
Replace:
\1\2
1
solved How to concatenate multiples lines under first occurence of the header using Unix commands?
If you don’t mind pushing this through multiple passes, I might suggest this:
Search:
^(Query=.*\n)((?:(?!Query=).*\n)+)\1
Replace:
\1\2
1
solved How to concatenate multiples lines under first occurence of the header using Unix commands?