change lines by entries (doesn't count empty lines, and remove one for header)