EDIT: I know how to do this. I'm not looking for a solution, I'm looking for a process or existing program recommendation before I take the time to write something myself in some scripting language.
I have some HTML files in various directories which all have a similar structure:
<html>
<head>...</head>
<body>
<nav>...</nav>
<section>...</section>
</body>
</html>
I'd like to programmatically replace HTML sections with other sections (e.g. replace the <nav>
block with a different nav
block [specified in a file of my choosing]) for all the files I specify.
I think the ideal solution would be some sort of tool using lxml
or something similar in Python, but if there were an easy way to do it with *nixy tools, or an existing program to do this, I'd be happy to do that instead of putting together a script.