Google Docs电子表格:获取单独的行
我正在使用 Java API 更新 Google 电子表格CSV 文件。我创建了一种删除行的方法:
public void deleteRow(int row) throws IOException, ServiceException {
URL listFeedUrl = _worksheet.getListFeedUrl();
ListFeed feed = _service.getFeed(listFeedUrl, ListFeed.class);
List<ListEntry> entries = feed.getEntries();
ListEntry entry = entries.get(row);
entry.delete();
}
但是,问题是我必须获取所有条目才能获取我想要的一个条目。有没有一种方法可以获取一个甚至较小的条目子集,这样我就不必等待整个条目集返回而只删除一个条目? (在当前状态下,此方法需要很长时间才能在大型电子表格上运行)
I'm using the Java APIs to update a Google Spreadsheet from a CSV file. I've created a method for deleting a row:
public void deleteRow(int row) throws IOException, ServiceException {
URL listFeedUrl = _worksheet.getListFeedUrl();
ListFeed feed = _service.getFeed(listFeedUrl, ListFeed.class);
List<ListEntry> entries = feed.getEntries();
ListEntry entry = entries.get(row);
entry.delete();
}
however, the problem is that I have to get all the entries to get the one entry I want. Is there a way that I can get one or even a smaller subset of the entries so I don't have to wait for the entire entry set to return to only delete one entry? (In its current state, this method takes a long time to run on large spreadsheets)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过查看 http://code.google.com/ apis/spreadsheets/data/3.0/developers_guide.html#SendingStructuredRowQueries?
Have you tried looking at http://code.google.com/apis/spreadsheets/data/3.0/developers_guide.html#SendingStructuredRowQueries?