I've the following format of the file:
<common>
fitnes=0
genetic=1
method=0
</common>
<inputs>
foo=bar
bar=foo
</inputs>
<limits>
balance=200.00
</limits>
and I would like to delete everything what is between <inputs>
and </inputs>
(excluding pattern it-self) and replace it with the content from another file (e.g. foo.txt
). In other words lines with foo=bar
and bar=foo
would be replaced with another content.
Probably it can be similar to how you delete a multi-line match, like:
:g/<inputs/,/inputs>/d
but I'm not sure with what I should replace the d
in order to insert the content of another file, but I want to keep the matching pattern.
Similar approach would be to remove inner content of html tag, like
:/<inputs>/norm vitd
but then I don't know how would you add into it the content from the file.
Ideally I'm trying to find one liner, since it'll be part of another script.
How can I achieve that?