nsv-cli-0.0.7 is not a library.
NSV, CLI tool
Command-line tool for the NSV (Newline-Separated Values) format.
Installation
To install (or update) from crates.io, run
Usage
Sanitize
Clean up files corrupted by Microsoft's software.
# From file
# From stdin
|
The sanitize command:
- Strips UTF-8 BOM
- Normalizes CRLF to LF
- Errors on bare CR or mixed line endings
- NSV-agnostic, can be used on any text file
Validate
Check encoding and structural correctness.
The validate command:
- Checks for rejected strings: dangling backslashes, unknown escape sequences, missing termination
- Reports byte offsets and UTF-8-aware character columns for each issue (rely on byte offsets if you're not using UTF-8)
- with
--table, checks that all rows have equal length - Exits with 0 on success, 1 on warnings or errors
Transpose
Transpose a table.
Both t and transpose are valid, prefer the latter for long-living scripts.
|
The transpose command:
- Requires table input (all rows must have equal arity), errors on ragged data
- Allocates full input in memory (once, but still)
Stats
Structural overview of an NSV file. Output is itself NSV (2-column key-value table).
Lift / Unlift
Apply or reverse NSV escaping on each line.
# Lift: escape each line (empty lines become \, backslashes double, etc.)
# Unlift: unescape each line (inverse of lift)
# Roundtrip: unlift(lift(x)) == x
|
The lift command:
- Applies
escapeto each line of input - Turns empty lines into
\(the NSV empty cell token) - Is the line-level equivalent of the lift operation from the ENSV spec
The unlift command:
- Applies
unescapeto each line of input - Is the exact inverse of
lift