@kszongic/tsv2csv-cli
v1.0.0
Published
Convert TSV (tab-separated values) to CSV from the command line
Downloads
16
Maintainers
Readme
@kszongic/tsv2csv-cli
Convert TSV (tab-separated values) to CSV from the command line. Zero dependencies.
Install
npm install -g @kszongic/tsv2csv-cliUsage
# Pipe from stdin
cat data.tsv | tsv2csv
# Read from file
tsv2csv data.tsv
# Custom input delimiter
tsv2csv -d "|" data.txtOptions
| Flag | Description | Default |
|------|-------------|---------|
| -d, --delimiter <char> | Input field delimiter | \t (tab) |
| -q, --quote <char> | CSV quote character | " |
| -h, --help | Show help | |
| -v, --version | Show version | |
How It Works
- Splits each line by the input delimiter (tab by default)
- Wraps fields in quotes when they contain commas, quotes, or newlines
- Escapes quote characters by doubling them (RFC 4180 compliant)
Examples
Input (TSV):
name city note
Alice New York loves "coffee"
Bob San Francisco enjoys, hikingOutput (CSV):
name,city,note
Alice,New York,"loves ""coffee"""
Bob,San Francisco,"enjoys, hiking"License
MIT © 2026 kszongic
