sed help

i wanna replace an "X" to column that equals 10. say,

file1.txt

aaa 12
yyy 10
www 12

Output should be:

aaa 12
yyy X
www 12

Thanks in advance.

 sed 's/\([a-z]\+ \+\)10/\1X/' < ~/tmp/file1.txt
aaa 12
yyy X
www 12

Try this:

sed '/\(^[^0-9]*\)10\([^0-9]*$\)/s//\1X\2/g' file1.txt

Try:

awk '$2==10{$2="X"}1' file