summaryrefslogtreecommitdiff
path: root/lib.go
diff options
context:
space:
mode:
authorraochq <31030448+raochq@users.noreply.github.com>2021-08-15 01:19:49 +0800
committerGitHub <noreply@github.com>2021-08-15 01:19:49 +0800
commitb02f864eab5edb2155601b9dd640f99fbd442cb3 (patch)
treec2fb09f4bc8885c12240deae30ee8004720694d1 /lib.go
parent48c16de8bf74df0fa94a30d29e2e7e3446d48433 (diff)
This closes #844, support get shared formula
Diffstat (limited to 'lib.go')
-rw-r--r--lib.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib.go b/lib.go
index 712576d..81f1e53 100644
--- a/lib.go
+++ b/lib.go
@@ -93,13 +93,12 @@ func readFile(file *zip.File) ([]byte, error) {
//
func SplitCellName(cell string) (string, int, error) {
alpha := func(r rune) bool {
- return ('A' <= r && r <= 'Z') || ('a' <= r && r <= 'z')
+ return ('A' <= r && r <= 'Z') || ('a' <= r && r <= 'z') || (r == 36)
}
-
if strings.IndexFunc(cell, alpha) == 0 {
i := strings.LastIndexFunc(cell, alpha)
if i >= 0 && i < len(cell)-1 {
- col, rowstr := cell[:i+1], cell[i+1:]
+ col, rowstr := strings.ReplaceAll(cell[:i+1], "$", ""), cell[i+1:]
if row, err := strconv.Atoi(rowstr); err == nil && row > 0 {
return col, row, nil
}