Convert tabs to spaces, trim white space and add newline at eof