Hi, @uwe-helmer,
Ah, OK ! Sorry for my late reply, but I was studying the haunting problem of the suppression of duplicate lines, without corrupting the order of the file contents :-)) See, below :
So, let’s consider your example text, below, in a new tab :
{Ausgang {door {Eingang} {Eintritt} {entry {exit} {gate} {gateway} {ingress {Pforte} {Portal} {slammer} {Tor {Türe} {Zugang} Gatter Tor Torbogen Treppen Stufen Wände Gelaender {banister {handrail} {railing} Innenraum {interior}Open the Replace dialog ( Ctrl + H )
Check the Regular expression search mode
SEARCH (?-s)^\{.*[^}\r\n](?=\R)
REPLACE $0}
Click, once, on the Replace All button ( or, successively, on the Replace button )
=> You should get the text :
{Ausgang} {door} {Eingang} {Eintritt} {entry} {exit} {gate} {gateway} {ingress} {Pforte} {Portal} {slammer} {Tor} {Türe} {Zugang} Gatter Tor Torbogen Treppen Stufen Wände Gelaender {banister} {handrail} {railing} Innenraum {interior}Et voilà !
Notes :
First, the (?-s) modifier forces the regex engine to interpret the special . character as matching a single standard character, only
Then, the part ^\{ looks the \{ character, at beginning of line ^. Note that the special { regex character have to be escaped !
Now, the part .* searches any amount, even empty, of standard characters, till …
A character different from the } character ( part [^}\r\n] ) which is followed by EOL characters ( look-ahead feature (?=\R) )
The part [^}\r\n] is a negative character class, looking for any character, different from, either, the } character, the EOL character \r and the EOL character \n
The \R stands for any kind of line break ( \r\n, \n or \r )
In replacement, it rewrites the overall matched string $0, simply followed by the } character
Best Regards,
guy038