Skip to content

get text of excel cell other than raw data? #725

Closed Answered by retsyo
retsyo asked this question in Q&A
Discussion options

You must be logged in to vote

In English

I found the solution.

I just write the answer here in case someone else needs it. But I am using nim-lang

            elif cell.CellType() == 0: # Numeric
                var datafmt = @DataFormatter.new()
                var cellvalue = datafmt.FormatCellValue(cell)

                return cellvalue

            elif cell.CellType() == 2: # Formula
                # no need to judge/deal with Cached type?
                var datafmt = @DataFormatter.new()
                var cellvalue = datafmt.FormatCellValue(cell, @SheetUtil.dummyEvaluator())

however, some format can't be evluated by dummyEvaluator, for example, 一九〇〇年一月三日, the date in Chinese, and more. I don't know wether …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by retsyo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant