test file, formatting for first, last, and non first-last lines