15

I need to use gnumeric's file conversion tool ssconvert on a server.

The problem is that gnumeric is a gnome application and can't be installed without a desktop installed.

There is also no separate packages for ssconvert, and I can not compile it from source code...

I need this specific conversion tool cause it can covert from Excel XML format to CSV, which I was unable to do with other excel conversion tools.

I am working on a ubuntu 12.04 server. I would appreciate any ideas.

5 Answers 5

11

I think many of the dependencies for gnumeric are actually "recommended" packages, not real dependencies. Try this:

sudo apt-get install --no-install-recommends gnumeric

For me, this installed about 37MB of packages, most of which were libraries and icon themes, which I felt was tolerable.

1
  • I need access inside a chroot. ssconvert does not play nice without it's real deps.
    – Richard
    Nov 22, 2021 at 16:30
1

I know you're asking specifically about ssconvert, but in my case I gave up trying to install gnumeric without the Gnome dependencies. Instead, I'm using xls2csv (which is part of the catdoc package) with the same results.

Suppose you have a source.xls file. This command:

xls2csv -s 8859-1 -d 8859-1 source.xls > destination.csv

will do the trick. The parameters -s y -d specify the source and destination charset. This example will process a source file that includes special characters such as 'ñ'. Hope this helps!

1
  • I think I have tried this one, but will not work with the XML format of excel. I still haven't found a tool that can convert from Excel XML format to CSV Jul 30, 2012 at 18:45
1

I just installed gnumerics on my Ubuntu server : it installs a lot of dependancies, such as gnome and others, which seems heavy, but you don't need to load the desktop environment to use ssconvert.

My advice is : simply install it, don't care about gnome and desktops.

2
  • I don't really know if it is a good idea to install gnome on servers... it kinda makes them slower I guess? Sep 19, 2013 at 12:42
  • 1
    I'm reluctant to do this because I feel that anything you install introduces a potential security hole. I'd like to keep my servers as lean as possible. Feb 18, 2014 at 0:38
1

You can also use in2csv of package csvkit. https://csvkit.readthedocs.io/en/1.0.2/

2
  • not sure python is a fair trade.
    – Richard
    Nov 22, 2021 at 16:29
  • This tool can't convert Excel XML (SpreadsheetML XLS)
    – John Smith
    Jun 17, 2023 at 13:53
1

Further to the answer from @IanPhillips:

sudo apt-get install --no-install-recommends gnumeric

I've just tried this on a clean headless Ubuntu 20.04 server VM. apt claimed it would be a 115MB install; in the event, df showed a usage increase of 151,492 1K blocks. The packages installed don't seem objectionable, but it is pretty heavy. However, the current in2csv (1.0.6) is pretty useless, so had to be replaced. Note that a straightforward/naive in2csv install can use up 400MB just to get the installer (apt install python3-pip).

When installed this way, ssconvert correctly processes my xls and xlsx test files, with over 3000 test conversions on time-formatted cells. LibreOffice also converts these files correctly when run headless, but in2csv fails on the xls files.


The following additional packages will be installed:
  adwaita-icon-theme fontconfig fontconfig-config fonts-dejavu-core gnumeric-common gsfonts gtk-update-icon-cache hicolor-icon-theme humanity-icon-theme
  libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3 libavahi-common-data libavahi-common3 libcairo-gobject2 libcairo2 libcolord2 libcups2
  libdatrie1 libepoxy0 libfontconfig1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgoffice-0.10-10 libgoffice-0.10-10-common libgraphite2-3 libgsf-1-114
  libgsf-1-common libgtk-3-0 libgtk-3-common libharfbuzz0b libjbig0 libjpeg-turbo8 libjpeg8 liblcms2-2 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0
  libpixman-1-0 librest-0.7-0 librsvg2-2 librsvg2-common libsoup-gnome2.4-1 libthai-data libthai0 libtiff5 libwayland-client0 libwayland-cursor0 libwayland-egl1
  libwebp6 libxcb-render0 libxcb-shm0 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxrandr2 libxrender1 pxlib1 ubuntu-mono
Suggested packages:
  gnumeric-plugins-extra fonts-liberation | ttf-mscorefonts-installer libgsf-1-dev colord cups-common gvfs liblcms2-utils librsvg2-bin
Recommended packages:
  gnumeric-doc evince lp-solve at-spi2-core libgdk-pixbuf2.0-bin libgtk-3-bin
The following NEW packages will be installed:
  adwaita-icon-theme fontconfig fontconfig-config fonts-dejavu-core gnumeric gnumeric-common gsfonts gtk-update-icon-cache hicolor-icon-theme humanity-icon-theme
  libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3 libavahi-common-data libavahi-common3 libcairo-gobject2 libcairo2 libcolord2 libcups2
  libdatrie1 libepoxy0 libfontconfig1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgoffice-0.10-10 libgoffice-0.10-10-common libgraphite2-3 libgsf-1-114
  libgsf-1-common libgtk-3-0 libgtk-3-common libharfbuzz0b libjbig0 libjpeg-turbo8 libjpeg8 liblcms2-2 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0
  libpixman-1-0 librest-0.7-0 librsvg2-2 librsvg2-common libsoup-gnome2.4-1 libthai-data libthai0 libtiff5 libwayland-client0 libwayland-cursor0 libwayland-egl1
  libwebp6 libxcb-render0 libxcb-shm0 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxrandr2 libxrender1 pxlib1 ubuntu-mono
0 upgraded, 66 newly installed, 0 to remove and 56 not upgraded.
Need to get 25.4 MB of archives.
After this operation, 115 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .