使用 Python,我尝试检查 Google 表格中的每个单元格是否有删除线,并返回没有删除线的行。我遇到的问题是达到当前分钟的配额限制,因为我正在检查 150 多行。另外,我需要检查 11 张纸,每张纸有 50 到 200 行。
有没有办法“batchGet()”格式化,而不仅仅是值,这样我就不会达到配额限制?
我不确定真正需要什么示例代码,所以这是我的工作“这个单元格是否用删除线格式化”定义:
def row_has_strikethrough(sheet, i):
return 'strikethrough=True' in str(get_user_entered_format(sheet, 'A' + str(i)))
这在我的 while 循环中有效,但我再次达到了配额:
last_row = int(sheet.acell('C1').value) # 166
i = 3
while i <= last_row:
if not row_has_strikethrough(sheet, i):
records += get_record(sheet, MAPPING, i)
i += 1
任何帮助将不胜感激!
Using Python, I'm trying to check each cell in a Google Sheet for a strikethrough and return the rows without a strikethrough. The problem I run into is reaching my quota limit for the current minute since I'm checking 150+ rows. Plus I need to check 11 sheets with anywhere from 50-200 rows each.
Is there a way to "batchGet()" formatting, not just values, so I don't hit my quota limit?
I'm not sure what example code is really needed so here's my working "is this cell formatted with a strikethrough" definition:
def row_has_strikethrough(sheet, i):
return 'strikethrough=True' in str(get_user_entered_format(sheet, 'A' + str(i)))
This works within my while loop but again, I hit the quota:
last_row = int(sheet.acell('C1').value) # 166
i = 3
while i <= last_row:
if not row_has_strikethrough(sheet, i):
records += get_record(sheet, MAPPING, i)
i += 1
Any help would be greatly appreciated!
发布评论
评论(1)
我相信您的目标如下。
,我正在尝试检查Google表中的每个单元格中的罢工,并在没有罢工的情况下返回行。
,从您的返回'strikethrough = true'str(get_user_entered_format(get_user_entered_format)(表格,'a' + str(i)))
,我认为您可能想检查列“ A”的单元格值是否具有罢工。如果我的理解是正确的,那么以下示例脚本怎么样?
示例脚本:
在此脚本中,使用了2个API调用API。
测试:
在样本电子表格中使用此脚本时,将获得以下结果。
该输出值具有每个表的行。这些行是“ a”列的没有罢工的行。
参考:
I believe your goal is as follows.
I'm trying to check each cell in a Google Sheet for a strikethrough and return the rows without a strikethrough.
, from your script ofreturn 'strikethrough=True' in str(get_user_entered_format(sheet, 'A' + str(i)))
, I thought that you might have wanted to check whether the cell value of column "A" has the strikethrough.If my understanding is correct, how about the following sample script?
Sample script:
In this script, 2 API calls of Sheets API are used.
Testing:
When this script is used in a sample Spreadsheet, the following result is obtained.
This output value has the rows of each sheet. Those rows are the rows without the strikethrough at column "A".
References: