-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong worksheet retrieved from xlsx file exported from Google Sheets #104
Comments
With the example Jenny posted, it does not matter if integer or string numbers are used becuase The issue is that for google sheets generated files the assumptions about numbering of the worksheet files within the bundle is incorrect. The constructor for
but the correct place to look for the integer -> filename mapping seems to be in the <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet3.xml"/>
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet4.xml"/>
<Relationship Id="rId6" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/>
<Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet5.xml"/>
<Relationship Id="rId7" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet2.xml"/>
</Relationships> It is possible that the order here is the Correct order (I've not looked at the spec) but this is the same order as the workbook. So if we want the "first" sheet it is actually "worksheets/sheet3.xml" rather than "worksheets/sheet1.xml". |
Related to tidyverse/readxl#104 with sheets that come out of googlesheets
Poking around in xlsx for my own purposes. I am staring at a clean table of worksheet info, so recording here in case it is helpful. A data frame with one row per worksheet in mini-gap.xlsx (a Google Sheet version).
|
When I use
read_excel()
on anxlsx
file obtained by downloading a Google Sheet asxlsx
, thesheet =
argument doesn't behave as expected. I don't get the sheet I request, regardless of whether I provide an integer or sheet name. If I open the file in Excel, re-save and try again, everything works fine. I've confirmed this withxlxs
files from two different Google Sheets. I don't know if Google Sheets exports weird/brokenxlsx
or what?Here's a complete example:
https://gist.github.com/jennybc/279ab4675f5f4d275350#file-2015-05-23_read-excel-sheet-md
The text was updated successfully, but these errors were encountered: