Offline table convert tool. In progress, Not production ready.
tableconvert
command line tool, which is writen in Go. It's designed for converting between different table formats, such as MySQL Query Output, Excel/CSV, SQL queries, and potentially other tabular data structures.
- Multi-format Conversion: Easily transform data between different formats, such as MySQL Query Output, Markdown, Excel/CSV, SQL queries, and potentially other tabular data structures.
- Offline available: No need to connect to the internet to convert between formats. Your data is safe and secure.
- Template Support: Support template output, which can be used to generate any other formats, like
PHP
,Python
data structs, etc. - Cross-platform: Support Windows, Linux, and Mac OS.
# Convert from CSV to JSON
tableconvert --from=csv --to=json --file=input.csv --result=output.json
# Read from stdin and write to stdout
cat input.csv | tableconvert --from=csv --to=json
# Convert from MySQL to Markdown using template
tableconvert --from=mysql --to=template --file=input.csv --tempalte=markdown.tmpl
More usage info please refer to Usage.
Each format or file type has its own arguments, please refer to the arguments.md for more details.
- Excel
- CSV
- XML
- HTML
- Markdown
- JSON
- JSONL
- SQL
- MySQL
- LaTeX
- MediaWiki
- TWiki/TracWiki
- User Define template Output
+----------+--------------+------+-----+---------+----------------+
| FIELD | TYPE | NULL | KEY | DEFAULT | EXTRA |
+----------+--------------+------+-----+---------+----------------+
| user_id | smallint(5) | NO | PRI | NULL | auto_increment |
| username | varchar(10) | NO | | NULL | |
| password | varchar(100) | NO | | | |
+----------+--------------+------+-----+---------+----------------+
FIELD,TYPE,NULL,KEY,DEFAULT,EXTRA
user_id,smallint(5),NO,PRI,NULL,auto_increment
username,varchar(10),NO,,NULL,
password,varchar(100),NO,,,
| FIELD | TYPE | NULL | KEY | DEFAULT | EXTRA |
|----------|--------------|------|-----|---------|----------------|
| user_id | smallint(5) | NO | PRI | NULL | auto_increment |
| username | varchar(10) | NO | | NULL | |
| password | varchar(100) | NO | | | |
INSERT INTO `{table_name}` (`FIELD`, `TYPE`, `NULL`, `KEY`, `DEFAULT`, `EXTRA`) VALUES ('user_id', 'smallint(5)', 'NO', 'PRI', NULL, 'auto_increment');
INSERT INTO `{table_name}` (`FIELD`, `TYPE`, `NULL`, `KEY`, `DEFAULT`, `EXTRA`) VALUES ('username', 'varchar(10)', 'NO', '', NULL, '');
INSERT INTO `{table_name}` (`FIELD`, `TYPE`, `NULL`, `KEY`, `DEFAULT`, `EXTRA`) VALUES ('password', 'varchar(100)', 'NO', '', '', '');