Thanks!
Initially it didn't work, and returned "command not found" but after a little research I realised that
nawk is just "new awk" so subtituted
awk, and it worked. (I don't think OS X has nawk installed)
Thank you very much.
Secondary question, if you have time, could you explain
how it's working...
What are the various parts of that command doing? It would help me in the future to understand what is going on.
Cheers.