I searched the archive and found this question asked back in Nov 2011:
https://groups.google.com/group/google-spreadsheets-api/browse_thread/thread/6cbb63e9d1641892

However, I don't see a solution that I can use, so I am posting the
same question again.

I am able to insert rows into a worksheet where the first row has
column names defined. However, my use case is to pipe a bunch of rows
into a new worksheet, and the first row may or may not be a header
(for that matter I wouldn't even care). I was able to successfully use
the batch cell update (using cell feed returned by
gdata.spreadsheets.data.build_batch_cells_update()), however there
needs to be enough number rows for this to succeed. Once I reach the
end of the sheet, I need to either add more blank rows, and continue
doing batch cell update or switch to a different method to insert rows
directly (that doesn't rely on having a header row). I found this SO
thread with a Java solution:

http://stackoverflow.com/questions/7100446/batch-insertion-of-spreadsheet-cells-using-gdata-objectivec-client-not-working

Some of that API is missing in Python, but I tried doing a batch
insert of gdata.spreadsheets.data.CellEntry via
gdata.spreadsheets.data.CellsFeed.AddInsert(), however the subsequent
gdata.spreadsheets.client.SpreadsheetsClient.batch() does nothing and
there is no error either.

If my data has more columns than what the worksheet has, I would also
need to add more columns, but this is of lower priority for me right
now.

Reply via email to