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 GetRows to retrieve unformatted cell values #621

Closed
wants to merge 5 commits into from

Conversation

tgulacsi
Copy link

This allows converting to time.Time without goint throguh the formatting and parsing steps.
Use the stored floating point number insted.

The only remaining step is a helper that decides whether the cell is a date or not (sth. like File.Styles.CellXfs.Xf[cell.S].NumFmtID IN (14, 15, 16, 17, 22)).

Checklist

  • My code follows the code style of this project.
  • [-] My change requires a change to the documentation.
  • [-] I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • [-] I have added tests to cover my changes.
  • All new and existing tests passed.

@xuri xuri added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 30, 2020
@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2020

Codecov Report

Merging #621 into v2 will decrease coverage by 0.08%.
The diff coverage is 85.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##               v2     #621      +/-   ##
==========================================
- Coverage   96.67%   96.59%   -0.09%     
==========================================
  Files          30       30              
  Lines        8932     8948      +16     
==========================================
+ Hits         8635     8643       +8     
- Misses        183      191       +8     
  Partials      114      114              
Impacted Files Coverage Δ
date.go 95.91% <0.00%> (-4.09%) ⬇️
lib.go 100.00% <100.00%> (ø)
rows.go 94.61% <100.00%> (-1.07%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 843bd24...7f463cd. Read the comment docs.

@tgulacsi
Copy link
Author

tgulacsi commented Aug 9, 2020

Shall I update this? Is there any possibility that this may be merged or at least reviewed?

@tgulacsi
Copy link
Author

Hi @xuri, shall I update this?

@xuri
Copy link
Member

xuri commented Aug 10, 2020

Hi @tgulacsi, thanks for your PR. I need some time to review.

@xuri xuri self-requested a review August 10, 2020 11:22
To be able to convert the to time.Time with ExcelDateToTime,
without de-formatting them
To be able to convert the to time.Time with ExcelDateToTime,
without de-formatting them
@codecov-io
Copy link

codecov-io commented Oct 23, 2020

Codecov Report

Merging #621 (7c148ab) into v2 (71829c5) will decrease coverage by 0.05%.
The diff coverage is 80.95%.

Impacted file tree graph

@@            Coverage Diff             @@
##               v2     #621      +/-   ##
==========================================
- Coverage   96.73%   96.67%   -0.06%     
==========================================
  Files          31       31              
  Lines        8626     8635       +9     
==========================================
+ Hits         8344     8348       +4     
- Misses        160      165       +5     
  Partials      122      122              
Impacted Files Coverage Δ
date.go 96.59% <0.00%> (-3.41%) ⬇️
rows.go 93.15% <92.85%> (-0.55%) ⬇️
lib.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 71829c5...7c148ab. Read the comment docs.

@xuri
Copy link
Member

xuri commented Aug 15, 2021

Hi @tgulacsi thanks for your PR, and sorry for my so late reply. I suggest adding an option for columns and rows iterator, to support specified if apply number format, instead of adding the new function RawColumns, so I'll close this.

@xuri xuri closed this Aug 17, 2021
@tgulacsi
Copy link
Author

Ok, I can add a "rawValues bool" to Cols, Rows, rowsXMLIterator & co. structs, but how to allow setting these parameters?
Export them, or add a "SetRawOption(bool)" method to them?

xuri added a commit that referenced this pull request Sep 5, 2021
- Support text comparison in the formula, also ref #65
- `GetCellValue`, `GetRows`, `GetCols`, `Rows` and `Cols` support to specify read cell with raw value, ref #621
- Add missing properties for the cell formula
- Update the unit test for the `CalcCellValue`
@xuri
Copy link
Member

xuri commented Sep 5, 2021

Hi @tgulacsi, I've added optional parameters for the GetCellValue, GetRows, GetCols, Rows, and Cols, to support specific read cells with raw value, please try upgrade to the master branch. For example, disable apply number format on get rows:

rows, err := f.GetRows("Sheet1", excelize.Options{RawCellValue: true})

@tgulacsi
Copy link
Author

tgulacsi commented Sep 5, 2021

Thanks, that's perfect!

jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this pull request Oct 22, 2023
- Support text comparison in the formula, also ref qax-os#65
- `GetCellValue`, `GetRows`, `GetCols`, `Rows` and `Cols` support to specify read cell with raw value, ref qax-os#621
- Add missing properties for the cell formula
- Update the unit test for the `CalcCellValue`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants