从 Google Sheet 中删除整行

Remove whole row from Google Sheet

如果我知道行索引,如何从 Google 表格中删除整行? 也应该批量删除。

我使用 Google.GData.Spreadsheets.

提前致谢。

勾选Delete rows or columns

POST https://sheets.googleapis.com/v4/spreadsheets/spreadsheetId:batchUpdate

{
  "requests": [
    {
      "deleteDimension": {
        "range": {
          "sheetId": sheetId,
          "dimension": "ROWS",
          "startIndex": 0,
          "endIndex": 3
        }
      }
    },
    {
      "deleteDimension": {
        "range": {
          "sheetId": sheetId,
          "dimension": "COLUMNS",
          "startIndex": 1,
          "endIndex": 4
        }
      }
    },
  ],
}