I’m trying to remove “()” from text file using python.
My input line looks like this:
N1B N 1.2620(4) 0.3320(4) 0.0049(7)
I want:
N 1.2620 0.3320 0.0049
Basically do not want any number that is wrapped by parentheses, and want to discard the first column.
Use regular expressions with
re:?sign is for making you regex lazy. Without it you’ll get:If you want to delete only digits, use
\dinsted of.: