Microsoft Excel (XLSX) to Unicode Separated Values (USV) Rust crate

Overview

xlsx-to-usv

Convert Microsoft Excel (XLSX) to Unicode Separated Values (USV). Built with the USV Rust crate.

Syntax:

stdin | xlsx-to-usv [options] | stdout

Example:

cat example.xlsx | xlsx-to-usv

More examples below.

Options

Options for USV separators and modifiers:

  • -u, --unit-separator : Set the unit separator (US) string.

  • -r, --record-separator : Set the record separator (RS) string.

  • -g, --group-separator : Set the group separator (GS) string.

  • -f, --file-separator : Set the file separator (FS) string.

  • -e, --escape : Set the escape (ESC) string.

  • -z, --end-of-transmission : Set the end of transmission (EOT) string.

Options for USV style:

  • --style-braces : Set the style to use braces, such as "{US}" for Unit Separator.

  • --style-controls : Set the style to use controls, such as "\u{001F}" for Unit Separator.

  • --style-symbols : Set the style to use symbols, such as "␟" for Unit Separator.

Options for USV layout:

  • --layout-0: Show each item with no line around it. This is no layout, in other words one long line.

  • --layout-1: Show each item with one line around it. This is like single-space lines for long form text.

  • --layout-2: Show each item with two lines around it. This is like double-space lines for long form text.

  • --layout-units: Show each unit on one line. This can be helpful for line-oriented tools.

  • --layout-records: Show each record on one line. This is like a typical spreadsheet sheet export.

  • --layout-groups: Show each group on one line. This can be helpful for folio-oriented tools.

  • --layout-files: Show one file on one line. This can be helpful for archive-oriented tools.

Options for command line tools:

  • -h, --help : Print help

  • -V, --version : Print version

  • -v, --verbose... : Set the verbosity level: 0=none, 1=error, 2=warn, 3=info, 4=debug, 5=trace. Example: --verbose …

  • --test : Print test output for debugging, verifying, tracing, and the like. Example: --test

Install

Install:

cargo install xlsx-to-usv

Link: https://crates.io/crates/xlsx-to-usv

Example

Excel and USV have similar data concepts:

Excel USV
Workbook File
Worksheet Group
Row Record
Cell Unit

Suppose file example.xlsx contains this kind of data:

Worksheet 1
a,b
c,d

Worksheet 2
d,e
f,g

Run:

cat example.xlsx | xlsx-to-usv

Output:

Worksheet 1␟␞
a␟b␟␞
c␟d␟␞
␝
Worksheet 2␟␞
e␟f␟␞
g␟h␟␞
␝

If you prefer ASCII Separated Values (ASV) with zero-width character controls:

Run:

cat example.xlsx | xlsx-to-usv --style-controls

Output:

Worksheet 1\u{001F}\u{001E}
a\u{001F}b\u{001F}\u{001E}
c\u{001F}d\u{001F}\u{001E}
\u{001D}
Worksheet 2\u{001F}\u{001E}
e\u{001F}f\u{001F}\u{001E}
g\u{001F}h\u{001F}\u{001E}
\u{001D}

If you prefer to render markers with braces, to see the markers more easily:

cat example.xlsx | xlsx-to-usv --style-braces

Output:

Worksheet 1{US}{RS}
a{US}b{US}{RS}
c{US}d{US}{RS}
{GS}
Worksheet 2{US}{RS}
e{US}f{US}{RS}
g{US}h{US}{RS}
{GS}

For more, see the official repository:
Unicode Separated Values (USV)

FAQ

What converters are available?

When to use this command?

Use this command when you want to convert from XLSX to USV.

A typical use case is when you have XLSX data, such as a spreadsheet file, and you want to convert it to USV, such as to make the data easier to view in a terminal, or edit in a text editor, or maintain in a text format.

Our real-world use case is converting a bunch of XLSX spreadsheet exports from a variety of programs, including Excel, to USV so we're better-able to handle quoting, and multi-line data units, and Unicode characters in a wide variety of human languages.

Is USV aiming to become a standard?

Yes, USV is submitted to IETF.org as an Internet-Draft work in progress: link.

Can I build my own USV tools?

Yes, and you may freely use the USV RFC and USV Rust crate.

Help wanted

Constructive feedback welcome. Pull requests and feature requests welcome.

Tracking

  • Package: xlsx-to-usv-rust-crate
  • Version: 1.2.4
  • Created: 2024-03-09T13:33:20Z
  • Updated: 2024-04-11T18:32:40Z
  • License: MIT or Apache-2.0 or GPL-2.0 or GPL-3.0 or contact us for more
  • Contact: Joel Parker Henderson ([email protected])
You might also like...
Generic extensions for tapping values in Rust.

tap Suffix-Position Pipeline Behavior This crate provides extension methods on all types that allow transparent, temporary, inspection/mutation (tappi

Padding/aligning values without heap allocation

zero-copy-pads Padding/aligning values without heap allocation. Cargo Features std (default feature): Disable #![no_std]. Enable features that require

Quickly save and retrieve values for shell scripts.

Quickly save and retrieve values for shell scripts.

🍅 A command-line tool to get and set values in toml files while preserving comments and formatting

tomato Get, set, and delete values in TOML files while preserving comments and formatting. That's it. That's the feature set. I wrote tomato to satisf

Encode and decode dynamically constructed values of arbitrary shapes to/from SCALE bytes

scale-value · This crate provides a Value type, which is a runtime representation that is compatible with scale_info::TypeDef. It somewhat analogous t

A command line tool that resembles a debugger as well as Cheat Engine, to search for values in memory
A command line tool that resembles a debugger as well as Cheat Engine, to search for values in memory

Summary This is a small command-line tool designed to peek around memory of a running Linux process. It also provides filtering mechanisms similar to

Library uses file-based mmap to store key-values

Library uses file-based mmap to store key-values This is a Rust version of MMKV. By default, this lib uses CRC8 to check data integrity. If include fe

Macro to print variable(s) with values nicely (stripped from release builds)

log_macro Macro to print variable(s) with values nicely (stripped from release builds) Install cargo add log_macro Use Add this to top of file: #[mac

Use LLMs to generate strongly-typed values

Magic Instantiate Quickstart use openai_magic_instantiate::*; #[derive(MagicInstantiate)] struct Person { // Descriptions can help the LLM unders

Owner
SixArm
SixArm Software
SixArm
Blazingly fast Rust CLI app to sync data from a folder of excel workbooks into generated c# code for unity usage

Extensions supported ( .xls, .xlsx, .xlsm, .xlsb, .xla, .xlam, .ods ) Speed Test Image shows the results of 5000defs synced from 2 workbooks and 5 she

null 4 Feb 16, 2023
rsv is a command line tool to deal with small and big CSV, TXT, EXCEL files (especially >10G)

csv, excel toolkit written in Rust rsv is a command line tool to deal with small and big CSV, TXT, EXCEL files (especially >10G). rsv has following fe

Zhuang Dai 39 Jan 30, 2023
Command-line interface to Microsoft To Do

⚠ This is a hackathon project with no official support or quality guarantee Hackathon 2022 tdi The command-line interface, for some, is the natural wa

Microsoft Hackathons 5 Oct 26, 2022
Web-based tool that allows browsing and comparing symbol and type information of Microsoft Windows binaries across different versions of the OS.

WinDiff About WinDiff is an open-source web-based tool that allows browsing and comparing symbol and type information of Microsoft Windows binaries ac

Erwan Grelet 208 Jun 15, 2023
a crate to swap values between possibly-overlapping references

omniswap: a crate to swap values between possibly-overlapping references Motivating Example You cannot simply use std::mem::swap to replace values wit

Masaki Hara 21 Nov 30, 2022
Detects whether a terminal supports unicode.

Detects whether a terminal supports unicode. This crate is a Rust port mashing together @sindresorhus' is-unicode-supported and @iarna's has-unicode N

Kat Marchán 11 Jul 29, 2022
omekasy is a command line application that converts alphanumeric characters in your input to various styles defined in Unicode.

omekasy is a command line application that converts alphanumeric characters in your input to various styles defined in Unicode. omekasy means "dress up" in Japanese.

null 105 Nov 16, 2022
View your github contribution calander in unicode.

View your github contribution calander in the terminal Now in rust! gh-cal 0.1.0 marshmallow View your github contribution calander in unicode USAGE:

marshmallow 54 Sep 12, 2022
Eventually consistent values for Rust

Eventuals give you the most up-to-date snapshots of some value. They are like Futures that update over time, continually resolving to an eventually co

Edge & Node 110 Dec 31, 2022
Rust TUI library - Clipping region is a set of min/max x/y values applied to the existing region

TinyBit Clipping region is a set of min/max x/y values applied to the existing region A TUI lib This is not yet production ready T O D O TODO: bugs: T

Togglebit 13 May 3, 2022