simple awk help

Whats the syntax to find all lines that matches a text and print out specific fields after the match?

ex:
1: some random text
2: Full name: John E. Smith
3: some random text
4: Full name: Mary J. Lue
5: some random text

So I'd like to print out First names or last names or everything after matching "name:" how would I do that?

Something like that ?

awk '/name:/ {sub(/.*name:/, ""); print}' inputfile

Jean-Pierre.

Hi,

We can get the sir name as follows:

awk 'BEGIN{FS=":"} /name:/{print $3|"cut -f4 -d\" \"" }' names.txt

Regards,
Vinod.