replace tabs with spaces, close file handle