0
I have a file, and I would like to change a single character on lines 400 through 600. The character happens to be the 22nd character on each line. It is also the 5th column, so I tried the following:
awk '{if (NR>=400 && NR <=600) $5="B"; print}' file.txt
The problem is, between each column there is a precise number of spaces that get replaced by a single space when I do this. How can I change a single character without touching any other character, including delimiters, within a line range?