Export a Single Sheet of an Excel Spreadsheet as CSV from the Command Line with Open Office


/ Published in: Other
Save to your folder(s)

modified from branflake2267's post at oooforum.org:
http://www.oooforum.org/forum/viewtopic.phtml?t=52942

usage:
Paste into the Standard.Module1 macro file. Then, create xls2csv bash script containing:

#!/bin/bash
file="$(readlink -f "$1")"
/usr/lib/openoffice/program/soffice -invisible -headless -norestore "macro:///Standard.Module1.ConvertXls2Csv(\"$file\", \"$2\")"


The first argument is the xls file name, second is the name of the sheet:

`xls2csv ./spreadsheet.xls "Some Sheet"`

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.