Consider this sample.txt:
ATO N X B
AT H1 X BT
ATOM H25 X BAA
ATOM H3 X BUTZ
ATOM CA X BAT
I want to replace X's from lines 2-4, to "A" with awk or whatever, so output should be:
ATO N X B
AT H1 A BT
ATOM H25 A BAA
ATOM H3 A BUTZ
ATOM CA X BAT
I emphasize that X (or its substitute A) is 11th "entity" (including characters or spaces) in line, and should stay 11th "entity" in output, and every other "entity" should stay on its place as in original file.
How to do this? Thanks