Merge←{
⍝ Cut the template on '@', then replace every other part
⍝ by its value in the JSON namespace.
templateFile←⍺
jsonFile←⍵
template←⊃⎕NGET templateFile
ns←⎕JSON⊃⎕NGET jsonFile
getValue←{
0=⍴⍵:,'@' ⍝ '@@' → ,'@'
6::'???' ⍝ ~⍵∊ns.⎕NL ¯2 → '???'
⍕ns⍎⍵ ⍝ ⍵∊ns.⎕NL ¯2 → ⍕ns.⍵
}
∊getValue¨@(⍴⍴1 0⍨)'@'(1↓¨=⊂⊢)template
}