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

Add support for special characters within namedRegion. #407

Merged
merged 2 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: openxlsx
Title: Read, Write and Edit xlsx Files
Version: 4.2.5.9000
Version: 4.2.5.9001
Date: 2021-12-13
Authors@R:
c(person(given = "Philipp",
Expand Down Expand Up @@ -57,7 +57,7 @@ VignetteBuilder:
knitr
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.1.2
RoxygenNote: 7.2.0
Collate:
'CommentClass.R'
'HyperlinkClass.R'
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# openxlsx (development version)

* Add support for `namedRegion`s having dots and other special characters ([#338](https://github.com/ycphs/openxlsx/issues/338)).
* Add type blanks and not blanks to conditional formatting ([#311](https://github.com/ycphs/openxlsx/pull/311))

# openxlsx 4.2.5
Expand Down
3 changes: 1 addition & 2 deletions R/readWorkbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,8 @@ read.xlsx.default <- function(
# name, the name will be "'sheet 1'" instead of "sheet 1.
dn_sheetNames[wsp] <- gsub("^'+|'+$", "\\1", dn_sheetNames[wsp])
}

# namedRegion in between 'name="' and '"'
dn_namedRegion <- gsub(".*name=\"(\\w+)\".*", "\\1", dn)
dn_namedRegion <- gsub(".*name=\"([[:graph:]_]+)\".*", "\\1", dn)

if (length(dn) == 0) {
warning("Workbook has no named region.")
Expand Down