Skip to content
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

[load] read file with d3p1 namespace #1194

Merged
merged 1 commit into from
Dec 11, 2024
Merged

[load] read file with d3p1 namespace #1194

merged 1 commit into from
Dec 11, 2024

Conversation

JanMarvin
Copy link
Owner

Allows reading the file shared in tidyverse/readxl#736 by @hidekoji. The xml scheme is somewhat inconsistent. For instance it is mixing all lower case letters and camel case:

  • in [content_types.xml] there is a reference to sharedStrings.xml, the same is in /xl/_rels/workbook.xml.rels
  • in xl/ there is sharedstrings.xml
  • there is also a custom xml namespace d3p1 available in workbook.xml

There might be other shenanigans with these type of files, after all this only contains two worksheets with data. It looks like some Japanese finance data, at least I can read IFRS? So far there is only this single file available, therefore not sure that I will merge this.

library(openxlsx2)
url <- "https://www.dropbox.com/scl/fi/jirejqyyxig0cikk6i2bn/P_P1.xlsx?rlkey=iwhm91t9npo40596me1lewls8&dl=1"
wb <- wb_load(url)
wb_to_df(wb, sheet = 2) %>% .[seq_len(5), seq_len(5)]
#>           NA NA.1         NA.2               NA.3 日経会社コード
#> 2 カネコ種苗    P セグメント1 連結優先(IFRS優先)        0021804
#> 3 カネコ種苗    P セグメント2 連結優先(IFRS優先)        0021804
#> 4 カネコ種苗    P セグメント3 連結優先(IFRS優先)        0021804
#> 5 カネコ種苗    P セグメント4 連結優先(IFRS優先)        0021804
#> 6 カネコ種苗    P セグメント5 連結優先(IFRS優先)        0021804

@JanMarvin JanMarvin force-pushed the read_d3p1_file branch 2 times, most recently from b8f2cd2 to 3d587d2 Compare December 11, 2024 11:35
@JanMarvin JanMarvin merged commit 63ba501 into main Dec 11, 2024
9 checks passed
@JanMarvin JanMarvin deleted the read_d3p1_file branch December 11, 2024 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant