Hi I am usually using Ubuntu 16.04, but for the coming days, I have to use a MacBook, running 10.15 and fink installed. I usually convert xls(x) to org, using '(org-odt-convert-process "gnumeric") '(org-odt-convert-processes '(("gnumeric" "/usr/bin/ssconvert %i %o"))) But gnumeric does not exist in fink, does anybody know about an alternative? (Yes I know I should have used macports or homebrew, but now it is too late). Regards Uwe Brauer
[-- Attachment #1: Type: text/plain, Size: 692 bytes --] >>> "JJ" == Jeremie Juste <jeremiejuste@gmail.com> writes: Hello Jeremie > Hello Uwe, > If you have python or R at hand you might want to go for this option. > In R you would so something like. Thanks, I first tried out the python solution, so I installed 1. Xlsx2csv that works fine for xlsx fine but not, as the name indicates, xls 2. So I tried out csvkit, which should, in principle, also convert xls files, well for the xls files I used, it did not. So in summary, there are solutions for xlsx but I struggle fo find one for xls. (I most likely could try out unconv from libre office, that however is sort of slow). Regards Uwe [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 5673 bytes --]
Uwe, i don't know if it will work for you, but on my linux box i use =ssconvert= from the =gnumeric= package to convert from .xls to .csv. in one project, the make rule looks like ---- ${BDIRCSVS}/%.csv: xlsxs/%.xlsx ssconvert -T Gnumeric_stf:stf_csv $< fd://1 | \ awk '{ \ line = line $$0; \ ol = line; \ gsub("[^\"]", "", ol); \ if (length(ol)%2==0) { \ print line; \ line = "" \ } \ }' | \ grep '^,' | \ grep -v '^,,*$$' > $@ ---- (i could probably puzzle out why the awk and greps, but i don't recall at the moment.) cheers, Greg
[-- Attachment #1: Type: text/plain, Size: 568 bytes --] >>> "GM" == Greg Minshall <minshall@umich.edu> writes: Hi Greg > Uwe, > i don't know if it will work for you, but on my linux box i use > =ssconvert= from the =gnumeric= package to convert from .xls to .csv. > in one project, the make rule looks like Right this is what I also use in Ubuntu, but in fink there is no gnumeric, while in macports and homebrew there is (no it is a bit late to switch). I usually have to convert rather simple stuff like list of students, that is why I most likely can do it with a simpler approach that yours. Uwe [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 5673 bytes --]
If you're looking to go the python route of importing an xls file, you
could try the xlrd package. It's actually just for xls. I'm not sure if
it converts to csv, but once you have the spreadsheet open in python
that should be a pretty trivial exercise.
Cheers,
Nick
On 5/31/21 7:18 AM, Uwe Brauer wrote:
> Hi
>
> I am usually using Ubuntu 16.04, but for the coming days, I have to use
> a MacBook, running 10.15 and fink installed.
> I usually convert xls(x) to org, using
> '(org-odt-convert-process "gnumeric")
> '(org-odt-convert-processes '(("gnumeric" "/usr/bin/ssconvert %i %o")))
>
>
> But gnumeric does not exist in fink, does anybody know about an
> alternative?
> (Yes I know I should have used macports or homebrew, but now it is too
> late).
>
> Regards
>
> Uwe Brauer
>
>
[-- Attachment #1: Type: text/plain, Size: 515 bytes --] >>> "NS" == Nick Savage <nick@nicksavage.ca> writes: > If you're looking to go the python route of importing an xls file, you > could try the xlrd package. It's actually just for xls. I'm not sure > if it converts to csv, but once you have the spreadsheet open in > python that should be a pretty trivial exercise. Thanks, but what I was looking for was a command line package, like the one I mentioned, xlrd, seems to involve some more fiddling. I try, for the moment to surve with xlsx files. Uwe [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 5673 bytes --]