Grep a string and print a string from the line below it

I know how to grep, copy and paste a string from a line. Now, what i want to do is to find a string and print a string from the line below it. To demonstrate:
Name 1: ABC Age: 3
Sex: Male
Name 2: DEF Age: 4
Sex: Male

Output:
3 Male

I know how to get "3". My biggest problem is to get "Male". The info will ONLY come from the line below where you find "3".

Can anyone help me on this?

where is your code?

Everytime we interact I ask you to show your efforts :slight_smile:

awk '/Age: 3/{getline;FS=":";print $2}' inputfile

Something like this, perhaps?

Use a multiline regular expression like

Name \d+: [\w\s]+ Age: (\d+)\nSex: (\w+)\n

then peel off $1 and $2.

Im sorry rake. I only know how to get "3" by grep "Age" |awk '{print $4}' File1
but getting "Male" is my problem.

---------- Post updated 06-24-09 at 12:26 AM ---------- Previous update was 06-23-09 at 07:42 PM ----------

that is the syntax?