I have this sample file
{
{
doSomething();
}
}
What I am trying to achieve is:
{
{
doSomething();
}
}
I tried doing this
sed -r -i -e 's/}\n+}/}\n}/g' file.txt
but to no avail.
I want to remove the newlines between the closing parenthesis.
Note: I already read this How can I replace a newline (\n) using sed? and I am also aware of the N command but I can't create a working sed expression to achieve what I am trying to achieve.
doSomething()
?