I wouldn't bother with these white spaces and new line feeds, if it fails, then the user should fix the contents of the file to get rid of them