#Javascript (ES6), 63 bytes
Javascript (ES6), 63 bytes
a=>a.reduce((p,c)=>p+/(.+?)\s+#/.exec(c)[1].slice(p.length),'')
Takes input as an array of strings.
F=a=>a.reduce((p,c)=>p+/(.+?)\s+#/.exec(c)[1].slice(p.length),'')
input.oninput = update;
update();
function update() {
try {
output.innerHTML = F(input.value.trim().split`
`);
} catch(e) {
output.innerHTML = 'ERROR: INVALID INPUT';
}
}
textarea {
width: 100%;
box-sizing: border-box;
font-family: monospace;
}
<h2>Input:</h2>
<textarea id="input" rows="8">
a #Explanation of what 'a' does
bc #Bc
d #d
e #Explanation of e
fgh #foobar
ij #hello world
k #etc.
l #so on
mn #and
op #so forth
</textarea>
<hr />
<h2>Output:</h2>
<pre id="output">
</pre>