As you see, 6th columns are filled with numbers as, 1, 2, 3, 4, etc... and I want to make a conversion for these values such as:
if 6th column=1, write "RED";
if 6th column=2, write "BLUE";
...
Given that there are no tabs in your sample input nor in your sample output, and that if the spaces shown in your input had been tabs there is no 1 in field 5 (it is in field 6); I don't see how you got that output from the input you showed us using the code you showed us???
It looks like you have sample awk code from SriniShoo and perl code from Skrynesaver that will turn your sample input into your sample output ignoring the implication that you want tab separators in your output.
If you're running this on a Solaris system, change awk in SriniShoo's suggestion to /usr/xpg4/bin/awk , /usr/xpg6/bin/awk , or nawk . But, if the code you had shown us before produced the output you said it did, this isn't your problem?????
Next time, please save us all a lot of time and aggravation by telling us what OS and shell you're using and showing us sample input and output that matches the data you want to process.
A slightly modified version of SriniShoo's code should do what you want: