What is xcsv?
xcsv is a command-line tool written in Rust that converts Excel (.xlsx) workbook sheets into individual CSV files. It's designed to be fast and memory-efficient by streaming data directly, without loading entire workbooks into memory. This makes it ideal for handling very large Excel files.
Installation
Pre-built Binaries
You can download pre-built binaries for your operating system from the GitHub releases page.
From Source
To build from source, you'll need to have the Rust toolchain installed. You can then use cargo to build and install:
cargo build --release
The binary will be located at target/release/xcsv
.
Alternatively, you can install it directly using:
cargo install --path . --locked --force
Usage
List Sheets
To see a list of all sheet names in an Excel file:
xcsv <path-to-file.xlsx> list
Export Sheets
To export all sheets to a specified directory:
xcsv <path-to-file.xlsx> export -o <output-dir>
You can also specify a different delimiter (the default is a comma):
xcsv <path-to-file.xlsx> export -o <output-dir> -d ";"
Features
- Low memory usage via streaming.
- Automatic conversion of Excel dates and times to ISO 8601 format.
- Supports various cell types: strings, booleans, numbers, formulas, etc.
- Option to use different delimiters like commas or semicolons.
- Generated filenames are lowercased and sanitized.