Reformat tables/databases/spreadsheets.
Usage
- ssformat [options] FILE
- ssformat [options] FILE1 FILE2
Index
Option summary
Option details
--default-table=TABLE
name to use when a table name is needed and not supplied
--exclude-column=COLUMN
include all but the specified column in the output (repeat option to exclude multiple columns)
--header
extract column names only
--help
show how to use this program
--include-column=COLUMN
include only the specified column in the output (repeat option to include multiple columns)
--index
extract content of key columns only
--input-formats
list supported input database formats
--omit-header
remove column names
--paint
add color highlighting appropriate for highlighter diffs
--table=TABLE
operate on a single named table of a workbook/database
Examples
You can generate test file(s) for the examples that follow:
ssformat --test-file numbers.csv
ssformat --test-file numbers.sqlite
Example 1
ssformat numbers.csv numbers_converted.sqlite
Convert CSV format table to an Sqlite database table.
Example 2
ssformat numbers.sqlite numbers_converted.csv
Convert Sqlite database table to a CSV format table.
Example 3
ssformat numbers.sqlite -
Display contents of an Sqlite database table.
Patch formats
- tdiff: [default] reminiscent of the standard unix diff format for text
- csv: csv-compatible diff format
- hilite: colorful spreadsheet format
- index: tabular output showing relationship between rows and columns
- novel: mark all shared rows - remaining rows are unmatched
- ops: summarize modified rows in a table
- raw: verbose diff format for debugging
- review: spreadsheet diff format suitable for quickly accepting or rejecting changes
- sql: SQL format (data diffs only)
- stats: produce statistics on table changes
Database/spreadsheet file formats
CSV: plain-text delimiter-separated family of formats
- .csv: Comma-separated values
- .tsv: Tab-separated values
- .ssv: Semicolon-separated values
- .json: {
"type": "csv", // CSV family
"file": "fname.dsv", // File name
"delimiter": "|" // Delimiter character
}
SQLITE: file-based database
- .sqlite: Sqlite database file
- .json: {
"type": "sqlite", // Sqlite family
"file": "fname.db" // File name
}
- dbi:sqlite:fname.db (Force sqlite interpretation)
SQLITEXT: sqlite-format sql dump
- .sqlitext: SQL dump of Sqlite database
- .json: {
"type": "sqlitext", // Sqlitext family
"file": "fname.sql" // File name
}
- dbi:sqlitext:fname.sql (Force sqlitext interpretation)
JSONBOOK: Spreadsheet formats in json
- .jsonbook: Json spreadsheet
- .json: {
"type": "jsonbook", // Json spreadsheet
"file": "fname.sheet", // File name
"hash": "1" // Generate hash/dict/objects for each row when schema available
}
- dbi:jsonbook:fname.sheet (Force Json spreadsheet interpretation)
GNUMERIC: Spreadsheet formats (via gnumeric)
- .xls: Excel spreadsheet
- .xlsx: Excel spreadsheet
- .gnumeric: Gnumeric spreadsheet
- .ods: OpenOffice/LibreOffice spreadsheet
- .json: {
"type": "gnumeric", // Gnumeric family
"file": "fname.sheet" // File name
}
- dbi:gnumeric:fname.sheet (Force Gnumeric interpretation)
MDB: Access database format (via Mdbtools, READ-ONLY)
- .mdb: Access database file
- .json: {
"type": "access", // Access family
"file": "fname.db" // File name
}
- dbi:access:fname.db (Force Access interpretation)
JMDB: Access database format (via Jackcess)
- .mdb: Access database file
- .json: {
"type": "access", // Jackcess/access family
"file": "fname.db" // File name
}
- dbi:jackess:fname.db (Force Access interpretation)
MYSQL: database connector
- .json: {
"type": "mysql", // MYSQL connector
"database": "db_name", // Database name
"host": "localhost", // Host name
"port": "1111", // Port number
"username": "root", // Username
"password": "****" // Password
}
- dbi:mysql:database_name (Use default port, username, etc)
- dbi:mysql:database_name:username=USER:password=PASS
- dbi:mysql:database_name:host=HOST:port=PORT
SOCIALCALC: SocialCalc format (via mozjs)
- .socialcalc: SocialCalc spreadsheet file
- .sc: SocialCalc spreadsheet file
- .json: {
"type": "socialcalc", // SocialCalc family
"file": "sheet.txt" // File name
}
- dbi:socialcalc:sheet.txt (Force SocialCalc interpretation)
Version
ssformat version 0.6.5