Code:
awk '
NR == 18 {
i = sprintf ( "%s", substr ( $0, 1, 10 ) )
j = sprintf ( "%s", substr ( $0, 11 ) )
gsub ( "A", "Z", j )
gsub ( "B", "Y", j )
gsub ( "C", "X", j )
gsub ( "D", "W", j )
gsub ( "E", "V", j )
gsub ( "F", "U", j )
gsub ( "G", "T", j )
gsub ( "H", "S", j )
gsub ( "I", "R", j )
gsub ( "J", "Q", j )
gsub ( "K", "P", j )
gsub ( "L", "O", j )
gsub ( "M", "N", j )
gsub ( "N", "M", j )
gsub ( "O", "L", j )
gsub ( "P", "K", j )
gsub ( "Q", "J", j )
gsub ( "R", "I", j )
gsub ( "S", "H", j )
gsub ( "T", "G", j )
gsub ( "U", "F", j )
gsub ( "V", "E", j )
gsub ( "W", "D", j )
gsub ( "X", "C", j )
gsub ( "Y", "B", j )
gsub ( "Z", "A", j )
gsub ( "a", "z", j )
gsub ( "b", "y", j )
gsub ( "c", "x", j )
gsub ( "d", "w", j )
gsub ( "e", "v", j )
gsub ( "f", "u", j )
gsub ( "g", "t", j )
gsub ( "h", "s", j )
gsub ( "i", "r", j )
gsub ( "j", "q", j )
gsub ( "k", "p", j )
gsub ( "l", "o", j )
gsub ( "m", "n", j )
gsub ( "n", "m", j )
gsub ( "o", "l", j )
gsub ( "p", "k", j )
gsub ( "q", "j", j )
gsub ( "r", "i", j )
gsub ( "s", "h", j )
gsub ( "t", "g", j )
gsub ( "u", "f", j )
gsub ( "v", "e", j )
gsub ( "w", "d", j )
gsub ( "x", "c", j )
gsub ( "y", "b", j )
gsub ( "z", "a", j )
gsub ( 0, 9, j )
gsub ( 1, 8, j )
gsub ( 2, 7, j )
gsub ( 3, 6, j )
gsub ( 4, 5, j )
gsub ( 5, 4, j )
gsub ( 6, 3, j )
gsub ( 7, 2, j )
gsub ( 8, 1, j )
gsub ( 9, 0, j )
$0 = i j
}
1
' test_tdm.dat