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

specify data types for columns when reading excel #800

Open
AmjadHussainSyed opened this issue Mar 8, 2021 · 2 comments
Open

specify data types for columns when reading excel #800

AmjadHussainSyed opened this issue Mar 8, 2021 · 2 comments

Comments

@AmjadHussainSyed
Copy link

Description
Is it possible to specify data types for the given columns such as i want few columns to be read as date and few of them as tring

Data is very confidential so not posting any of the content here

Steps to reproduce the issue:

  1. read the excel file
  2. getrows
  3. column values are returned as float values.

Describe the results you received:
column values are returned as float values.

5.90606077E+08 | 966.0

Describe the results you expected:

590606077 | 966

Output of go version:

go version go1.15.6 darwin/amd64

Excelize version or commit ID:

v2.3.2

Environment details (OS, Microsoft Excel™ version, physical, etc.):
macOS Big Sur version 11.2.1
google sheets

@alkanna
Copy link

alkanna commented May 31, 2022

This problem has been ignored for a long time.
I am dealing with this issue with excel sheets exported from google sheets, with cells set as "plain text" in google sheets.
Numbers are read as float for some reason.

@xuri
Copy link
Member

xuri commented Jun 15, 2022

Sorry for may late reply. This library support GetCellType to get cell data type since v2.5.0, so you can convert the cell value from string to any data type you need. Please reference issue #414, and #520 for information.

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

No branches or pull requests

3 participants