multi-line replacement: add the last lines as files