It's not straightforward, but it can be done.
Archive of posts tagged awk
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
How to pass extra stuff without awk noticing