It's not straightforward, but it can be done.
Archive of posts filed under the awk category.
Stop asking for that.
This is asked very often, and the solution isn't always obvious (if at all).
Unlikely to help someone, but anyway.
Some ways to "pull out" strings from files