9399 shaares
13 liens privés
13 liens privés
Astuce ! Utiliser SQLite pour lancer une requête sur un fichier CSV et en récupérer le résultat. Le tout en une seule ligne de commande.
sqlite3 :memory: -cmd '.mode csv' -cmd '.import taxi.csv taxi' 'SELECT passenger_count, COUNT(*), AVG(total_amount) FROM taxi GROUP BY passenger_count'
This uses the special :memory: filename to open an in-memory database. Then it uses two -cmd options to turn on CSV mode and import the taxi.csv file into a table called taxi. Then it runs the SQL query.
Voir aussi https://dinedal.github.io/textql/