Modified to concat files together with before and after strings, as well
as being able to trim off whitespaces.