tealeg / xlsx

Go library for reading and writing XLSX files.
Other
5.81k stars 808 forks source link

v3 version proposal #801

Closed wzhsh90 closed 2 months ago

wzhsh90 commented 2 months ago

1、ForEachRow can not know the row index, for same situations we need to know the index .for example to import data from excel the header row need to check and the header row data should skip

2、ForEachCell the same need to know the cell index

3、There is no methods to get single row cells count . sometimes each row gains different cells . for example if the cells num is not match the num this row is invalid.

wzhsh90 commented 2 months ago

customer iterating rows and celll by himself is more conveniently . such as v1 verison

tealeg commented 2 months ago

@wzhsh90 The Row passed to the function you use in ForEachRow should be able to give you this information using Row.GetCoordinate(), likewise the Cell has Cell.GetCoordinates() which returns both the x and y coordinates within the sheet. If you need the Excel format CellID you can in turn use GetCellIDStringFromCoords on those coordinates.

I do agree that it was more natural to write the loops by hand in standard Go, but it requires instantiating all those rows and cells which was a memory hog.