[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua & Spreadsheets
- From: Dirk Laurie <dirk.laurie@...>
- Date: Wed, 16 Dec 2015 16:52:41 +0200
2015-12-16 15:18 GMT+02:00 Geoff Smith <firstname.lastname@example.org>:
> Just wondering if there are any libraries around to allow Lua to
> read/write data to Open Source Spreadsheets such as Libre Office,
> Google Spreadsheets, etc.
I get a couple of .xls files every week. Here is the relevant portion of
my program for reading them:
local filename = arg
assert(filename,"Must supply a filename")
assert(filename:match"%.csv$" or filename:match"%.xls$",
"Only .csv and .xls supported'")
if filename:match"xls$" then
local csvname = filename:gsub("xls$","csv")
local cmd = ("ssconvert %s %s > /dev/null 2> /dev/null"):
filename = csvname
The program "ssconvert" comes with gnumeric. It is by far the
best among several open-source commandline programs that
I have tried.
As Pierre has pointed out in a message that popped up
while I am writing this, once you have CSV, the rest is easy.