If you are an Android developer, you might be familiar with the excellent ACRA library which allows you to receive your Apps crash reports into your Google Docs account as a spreadsheet.
The only problem is Google Docs Spreadsheets fail catastrophically once they get to a certain size, you cant open them therefore you cant reduce their size, you cant download or export them. And if you choose to delete them then you will lose the connection between the App and the spreadsheet thus loosing any future crash reports (the spreadsheet and the app are linked by a form key imbedded in the App and unique on Google Docs).
After some Googling and a bit of script programming I have managed to find a fix that will allow you to reduce a spreadsheet without needing to open it!
This is mainly a modification of the Script by user Ronen I found on Accra-Discuss Google Group which works only from within the Spreadsheet which is impossible once you have already run into problems.
DATA LOSS:!! THIS SCRIPT WILL DELETE ROWS FROM THE SPREADSHEET TO HELP GET IT TO A WORKING SIZE.
How to fix:
- Go into any working Spreadsheet or create a new one.
- Go to Tools –> Script Editor…
- Select Blank Project
- A new empty Script is created, delete everything, paste in the code bellow. Get the code here: http://pastebin.com/vVasrXy1 , take the RAW one, copying the code bellow leads to errors because of html formatting!!
- Change the SPREADSHEET_KEY value to the value for the spreadsheet you are trying to fix, this can be obtained from the browser URL when trying to open a spreadsheet, or if you share a spreadsheet via a link this key is included in the link.
- SHEET_NAME is the name of the actual sheet within the spreadsheet, this is “Sheet1” unless you changed it.
- rowsToKeep is the number of Rows that will be left in the spreadsheet after the cleanup is done, in this case 1000.
- Save the Script by hitting the save button, Script will be saved to this Spreadsheet, not the broken one.
- Click the Play button to Run the Script, it can take a while.\
- Go and open the previously broken Spreadsheet, it has been fixed!!