ahamed101, I don't know why your codes not working. Seems legit though.
if solaris, use nawk.
And btw, what does $new_char in your code contain?
root@bt:/tmp# awk -v row=3 -v col=5 -v val='\\E[0;45m' '{if(NR==row){$col=val}}1' input_file
\E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m
\E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m
\E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;45m \E[0;40m \E[0;40m
\E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m
\E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m
\E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m
\E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m \E[0;40m
--ahamed
Oh that was just supposed to contain an escape code.
Sorry, I didn't get you. Can you show me?
--ahamed
For some strange reason, your code isn't working... Maybe is it because I'm on Cygwin? I can't see any output in my file when I open it.
new_char='\\E[0;45m' ?
--ahamed
---------- Post updated at 02:22 PM ---------- Previous update was at 02:21 PM ----------
you didn't miss the digit "1" towards the end of the code, did you?
--ahamed
Which would mean the fourth column if all columns are only one character wide.
The digit 1 is there. Where would I place the newchar?
Scrutinizer, the problem with sed, is that when I have to move it to a column, there is more than one occurence of the designated string, so what should I do?
You are right!
Here in this case, sed doesn't seem to consider \E[0;40m as one char I guess.
--ahamed
---------- Post updated at 02:34 PM ---------- Previous update was at 02:26 PM ----------
Try this... looks odd though!
sed "3 s/\(..\)40m /\145m /5" input_file > new_file
--ahamed
Nothing! :wall:
That should have worked. Maybe I'm putting in the wrong input file or something. Give me an example on how I should output to a file on the sed statement.
Try this without redirecting and see if it comes on the screen
sed "3 s/\(..\)40m /\145m /5" input_file
Please provide the output of the following commands
file input_file
cat -E input_file
od -bc input_file
Hope you didn't edit the file in windows!
--ahamed
IT WORKED! I'm so sorry. I forgot sed doesn't know how to read empty files and I left it empty.
lol This is the best forum ever. Thanks guys. 
oh man!!!... 
--ahamed
Now next question! ;D
How would I put a variable in place of the row and column to designate any row or column?
row=3;col=5;
sed "$row s/\(..\)40m /\145m /$col" input_file
--ahamed
Incredible! Once again. Thank you.