How can I read a gdoc file in Google Colab?

Question:

I’m trying to read a bunch of Google Docs files into Google collab to work with some text data.

It can’t seem to read in the ‘.gdoc’ file format, only the .txt file format.

Do I have to save all of them as .txt files first? Is there an efficient way to do this in python? Or is it possible to work with .gdoc files?

Thanks for any help!

Asked By: duncs

||

Answers:

Hi I have been stuck in same problem then the following worked for me.

  1. Go to Drive folder where all gdocs are present.
  2. Now simply right click on it and download whole folder.
  3. Google Drive automatically convert all gdocs to docx during that operation.
  4. Upload it on colab or use them locally.
Answered By: Danish Bansal

Does not work as described in the answer. Here is the error.

/usr/lib/python3.7/codecs.py in decode(self, input, final)
320 # decode input (taking the buffer into account)
321 data = self.buffer + input
–> 322 (result, consumed) = self._buffer_decode(data, self.errors, final)
323 # keep undecoded input until the next call

Answered By: Shail