如何在 Google 电子表格中的空行之后读取行?

Nya*_*baa 2 gdata-api gdata-python-client google-spreadsheet-api

我正在使用gdata-python-client从 Google 电子表格中读取数据。我读取行的代码如下:

import gdata.speadsheet.text_db

gd_client = gdata.spreadsheet.text_db.DatabaseClient(
                     username=setting['account_name'],
                     password=setting['account_pass'])

xls_db = gd_client.GetDatabases(spreadsheet_key=setting['spreadsheet_id'])
first_sheet = xls_db[0].GetTables()[0]
entries = first_sheet.GetRecords(1, 200)
Run Code Online (Sandbox Code Playgroud)

比方说,电子表格有160行和12行是空的。当我尝试使用上述代码读取所有 160 行时,它只读取前 11 行(即,直到它获得空的12行)。如果电子表格没有任何空行,代码将读取所有 160 行。

当我尝试从空行读取下一行时,它不返回任何内容。例如:

entries = first_sheet.GetRecords(50, 55) # entries is None
Run Code Online (Sandbox Code Playgroud)

如何从包含空行的 Google 电子表格中读取所有行。

任何帮助,将不胜感激。

air*_*een 5

抱歉,可能为时已晚,我刚刚发现了这个问题。:)

所以,这里是 Google Docs 电子表格 API 的文档:

http://code.google.com/apis/spreadsheets/data/3.0/developers_guide.html

答案是:

列表提要包含从第一行到第一个空白行的所有行。

顺便说一句,我认为当提要结束时,行数不多;你看到它是徒劳的。:)

干杯