Combine two awk commands

Hi,
Can someone please guide me how to combine the following two awk calls in one?
I noticed that it is very often situation for me, and I think that it can be replaced with one awk call.
The question is more general, not the exact one.

echo "A B C/D" | awk '{print $3}' | awk -F/ '{print $2}'

At the end I need just C.

echo "A B C/D" | awk -F'[ /]' '{print $(NF-1)}'

Another way:

echo "A B C/D" | awk '{split($3,F,"/"); print F[1]}' 

Didn't s/he need C ?

echo "A B C/D" | awk '{split($3,F,"/"); print F[1]}'
C
echo "A B C/D" | awk '{sub(".* ",x); sub ("/.*",x)}1'
C
1 Like
echo "A B C/D" | awk -F/ 'NF>1 && $0=$1' RS=" "