EDIT – I agree that this is a badly formed question for Stack Overflow but I didn’t realize Stack Exchange existed. FYI The Google Drive API was a red herring. I’m actually doing everything I want with a Python script to convert the Word text to JSON. Should I delete this question? –
I have 30 books, each with 40 chapters, in Google Docs and I want to export each book to a .csv file so each chapter is in its own “cell” string preserving the Google Docs formatting (bold, italics). Is there a way to do this with the Google Drive API or App Scripts? Gemini suggested I could do this with python so I followed the Workspace quickstart tutorial and have authenticated my connection but the rest of the code isn’t able to be used right out of the box and I’m afraid Gemini hallucinated almost everything.
I can use a download_file() but then Gemini says I can just “use a code library to parse the file” to identify the chapter headings (which are labeled as “Chapter One” and so forth in the h1 level — so I can match off name or something like the namedStyleType: “HEADING_1” and then using the same library I output the .csv. Does such a library really exist? Is there a much easier function that already exists in App Scripts etc that I could use instead?
wclark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3