bernhard.strohmeier@[EMAIL PROTECTED]
writes:
> Is it possible in AWK to assign a string by index into another string?
> I am looking for something like the subst() function in SQL.
>
> For example, if I would like to insert the string "abc" into the
> string "12345789", starting at position 3 overwriting the other
> elements the required result would be "12abc6789"
s = sprintf("%s%s%s", substr(s, 1, pos-1), insert, substr(s,
pos+length(insert)))
And in your example, s="123456789", pos=3, and insert="abc".
Cheers,
- Joel


|