Artificial intelligent assistant

replace a string from a specified line number and column I would like to replace from line number 4, the character "K" which is right after 19823 but not the "K" character which follows 19822SOL OW60021 7.173 19822SOL HW160022 7.230 19822SOL HW260023 7.124 19823K K60024 8.427 so the new file should look like 19822SOL OW60021 7.173 19822SOL HW160022 7.230 19822SOL HW260023 7.124 19823exc K60024 8.427 currently i do know how to use sed command to replace K from line 4 with exc such as sed -i "4s/K/exc/g" <newfile> but I do not know how to specify which column to select

If it's just about that particular `K`, then getting rid of the `g` flag will do, as `sed` will only replace `K` once. Thus:


sed -i "4s/K/exc/"


Namely, it replaces the first appearance of `K` with `exc` on line 4.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 34cd2c0bf85851336253792f5afa617c