I have a file with a lot of lines of text like so:
(text)
There are many instances where this occurs:
In textfile1.txt:
logging.info(text text text(text text) text text)
Which if I use:
$ sed -i '/(/,/)/d' textfile
Returns
' text text)'
There are also many instances like so:
(text
text text(text text)
text text)
I want to remove everything between the first opening parenthesis & and it's respective closing parenthesis (including both parenthesis). Doesn't matter what method is used, looking for any. Is this possible?
I tried writing my own python script but I didn't even remotely get close. It would be easier to look for a different solution than to fix my broken program I believe.
I've seen some other posts like:
Find text between Opening parenthesis closing [closed]
match opening parenthesis to the corresponding closing parenthesis
regex: parse opening closing parenthesis with other parenthesis in between
But I am really bad with regex and they all use regex and I don't know