Hi all,
I am looking for a way to overwrite (overtype?) characters in a file at a certain position programatically (i.e. from a Bash script).
For instance, say I have a file containing one line:
Code:
abc def ghi jkl mno
I want to script a process which writes '1234' to line 1, position 9 of my file. So the resulting file would be:
Code:
abc def 1234jkl mno
I have searched around and seen various suggestions of sed, awk, printf, but all the answers seem to be inserting text or find/replacing, thus resulting in:
Code:
abc def 1234 jkl mno
Imagine you load up a text processor and change the input mode from insert to overwrite - that's what I'm after, but programatically.
I'm sure I'm just wording my Google searches wrong, as I assumed this would be an easy task. Any advice or suggestions highly appreciated!
Cheers
Elliot