in reply to inline replace
You mean, is there some other way that is less brittle, ad-hoc and prone to outrageous failure? I should hope so.
But it would be hard to suggest decent improvements, because we don't have any reason to believe that line 4 of $F[0].xml must always be the place where your new <keywords> $F[1] </keywords> string should properly replace the original line content.
But a few things that would simplify your approach:
|
|---|