Crates.io | csv_transform |
lib.rs | csv_transform |
version | 0.1.0 |
source | src |
created_at | 2023-01-17 07:13:17.013522 |
updated_at | 2023-01-17 07:13:17.013522 |
description | A tool to read and transform CSVs with sqlite queries |
homepage | https://github.com/baabcantcode/organize/tree/master/csv_transform |
repository | https://github.com/baabcantcode/organize/tree/master/csv_transform |
max_upload_size | |
id | 760833 |
size | 43,150 |
csv_transform -- -f testin.csv "select * from table1 where big = 'feels'" testout.csv
Use this cli to run sql queries to transform 1+ input CSV files into a result CSV. This tool runs on sqlite, and you can refer to he standard sqlite docs for query rules. example usage with a single CSV input at ./thiscsv.csv
csv_transform -f thiscsv.csv "select * from table1 where id = '235'" out.csv
the output argument is optional, if it's skipped this will print to stdout (not guaranteed to follow CSV format when printed to stdout)
the initial table created from the csv will be named 'table1' and additional tables will be named in the order that they were given to this cli -> table2, table3 etc
the out.csv is a user defined file path which will be written to based on the user's query