mashingan / excelin Goto Github PK
View Code? Open in Web Editor NEWCreate and read Excel file purely in Nim
License: MIT License
Create and read Excel file purely in Nim
License: MIT License
#1 it seems this works as expected now, but other thing is showing up, here's how it looks like after and before saving:
btw, all this happens under linux/libreoffice calc
Hi,
let xl = readExcel("calc.xlsx")
let sheet = xl.getSheet("Calc")
sheet.row(1)["A"] = "hello"
xl.writeFile("calc-out.xlsx")
There was pie chart in different sheet in calc.xlsx and after running this code that chart was gone in calc-out.xlsx. I wonder is it a bug or saving a charts/diagrams is unsupported yet?
I see the pattern and gradient arguments in fillStyle
. But how can I do a normal flat background?
Sorry, I can't reopen issue that I haven't closed.
Here is what's happening at runtime:
Traceback (most recent call last)
/home/nick/Projects/Code/xlstest/src/xlstest.nim(53) xlstest
/home/nick/Projects/Code/xlstest/src/xlstest.nim(41) main
/home/nick/.nimble/pkgs/excelin-0.4.8/excelin/internal_rows.nim(7) row
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Hi, it looks like new issue is coming.
I try to parse excel column in a loop but I get a results from other columns
To reproduce I created minimal xlsx file with no formatting at all and run this code:
echo "-" & sheet.row(2)["E", string] &
"-" & sheet.row(2)["F", string] &
"-" & sheet.row(2)["G", string]
it prints: -ddd-aaa-bbb
Now, I use following script
import excelin
proc getLastRow(sheet: Sheet, col: string):int =
var rowNum:int = 1
type tmp = object
while sizeof(tmp) == 1:
let value = sheet.row(rowNum).getCell[:string](col)
if value == "":
break
inc(rowNum)
result = rowNum - 1
if isMainModule:
let excel = readExcel("src.xlsx")
let sheet = excel.getSheet(excel.sheetNames()[0])
let lastRow = sheet.getLastRow("A")
echo lastRow
but, If there is a blank cell between cells with values, this proc will not work.
I'm not sure it's an issue, anyways since v0.5.3 I get strange segfault (nim1.6.2):
Traceback (most recent call last)
/home/nick/xlstest/src/xlstest.nim(8) xlstest
/home/nick/.nimble/pkgs/excelin-0.5.3/excelin.nim(138) readExcel
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
zsh: segmentation fault (core dumped) ./xlstest
and with nim 1.9.5 i've got:
Traceback (most recent call last)
/home/nick/xlstest/src/xlstest.nim(8) xlstest
/home/nick/.nimble/pkgs2/excelin-0.5.3-ec9c2b93c098d062d83c3706198e5f9047d68460/excelin/internal_utilities.nim(71) readExcel
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
zsh: segmentation fault (core dumped) ./xlstest
the code is simply:
import excelin
let xl = readExcel("Test.xlsx")
xlsx file is empty, created with libreoffice,
may be I'm doing something wrong, but cant guess what exactly
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.