(Video materials in preparation)
filemrg : Merge a file into a template
Usage : filemrg -l<label> <template> <file>
Version : Mon Mar 18 07:47:06 JST 2013
Merge <file> into the lines within <template> that contain <label>.
If there are multiple lines with <label> then multiple <files>
will be merged.
$ cat template
<html>
<meta>
<!-- label-1 -->
</meta>
<body>
<!-- label-2 -->
</body>
</html>
$ cat file1
<script type="javascript/text">
function f(i) {
obj=getElementById(i);
}
</script>
$ cat file2
<p id="123">hello</p>
$ filemrg -llabel-1 template file1 | filemrg -llabel-2 - file2
<html>
<meta>
<script type="javascript/text">
function f(i) {
obj=getElementById(i);
}
</script>
</meta>
<body>
<p id="123">hello</p>
</body>
</html>