Thanks for the update. Actual We want to read multiple file formats and we want to read the file content irrespective of file format so thats why we have head.

With open is not working in notebook. How can we make that work?