Shell script:- Reading numbers embedded in brackets from a text file
I need to extract two numbers (variable in length) from a fixed pattern in a text file.
The pattern is like this:
Word1(123456) Word2(678923) Word3(987)
Now from above pattern I need to simply extract 123456, 678923 and put them in two variables using a shell script (bash).
I exhausted all options including using sed, cut, awk but could not find a suitable answer.