awk: syntax for "if (array doesn't contain a particular index)"

view story

http://www.unix.com – Hi! Let's say I would like to convert "1", "2", "3" to "a", "b", "c" respectively. But if a record contains other number then return "X". input: Code: 1 2 3 4 output: Code: a b c X What is the syntax for: Code: if(array doesn't contain a particular index){   then print the value "X" instead} How do we make the difference between the end of the input string Code: array[number]=="" and an unknown number in the array Code: array[4]=="X" ? In this way: Co (HowTos)