Fix Issue: #12422 blockreplace adding blank lines

file.blockreplace introduced an unwanted final new line when given
multi-line content due to split() behaviour.