I have a line with string of characters (BCCDDDCDCCDDDDDDABCDABCABDBACBDCAACCBBCABACBCCABCACBCDCCCBDBACDCBBCBCBCCCACADAACCABABADBCBAABBBCCBB)
I'd like to replace a specific character (for e.g, 4th character) to lower case.
I have tried with this awk command;
awk '{for (i=1; i<=NF; ++i) { $i=toupper(substr($i,1,1)) tolower(substr($i,2)); } print }' input > output
input file contains the string
"BCCDDDCDCCDDDDDDABCDABCABDBACBDCAACCBBCABACBCCABCACBCDCCCBDBACDCBBCBCBCCCACADAACCABABADBCBAABBBCCBB"
This awk command gives this output:
"Bccdddcdccddddddabcdabcabdbacbdcaaccbbcabacbccabcacbcdcccbdbacdcbbcbcbcccacadaaccababadbcbaabbbccbb"
How do I change all the other characters to lowercase except the 4th character?