I have an input:
This is a test
And I want to insert some letters in the middle of the word, like:
This is a teSOMETHINGst
I know I can define the needed word by $i
, but how can I modify the word that way?
I'm trying to do it like that:
{
i=4 # finding somehow
print (substr($i,1,(length($i)/2)) "SOMETHING" substr($i,(length($i)/2),(length($i)/2)))
}
As I'm new to awk
I wonder if it is a right way.