Sqawk is an SQL-based command-line tool for processing delimiter-separated files (CSV, TSV, etc.), inspired by the classic awk command. It loads data into in-memory tables, executes SQL queries against these tables, and writes the results back to the console or files.
-
Powerful SQL Query Engine
- Support for SELECT, INSERT, UPDATE, and DELETE operations
- WHERE clause filtering with comparison operators
- DISTINCT keyword for removing duplicate rows
- ORDER BY for sorting results (ASC/DESC)
- Column aliases with the AS keyword
- Aggregate functions (COUNT, SUM, AVG, MIN, MAX)
- GROUP BY for data aggregation
-
Multi-Table Operations
- Cross joins between tables
- INNER JOIN with ON conditions for precise join criteria
- Support for joining multiple tables
- Table-qualified column names
-
Smart Data Handling
- Automatic type inference (Integer, Float, Boolean, String)
- Type coercion for comparisons
- Null value support
-
File Format Support
- Process CSV, TSV, and custom-delimited files
- Custom field separator support with -F option (like awk)
- Fast in-memory execution
- Process multiple files in a single command
- Table name customization
- Chain multiple SQL statements
-
Safe Operation
- Doesn't modify files without explicit request (--write flag)
- Only writes back tables that were modified
- Verbose mode for operation transparency
This loads data.csv into an in-memory table called "data" and performs a SELECT query.
This updates the status field to 'active' for rows with id = 5 and saves the changes back to data.csv.
This removes rows with id = 5 and saves the changes back to data.csv.
This executes multiple SQL statements in sequence: first marking recent inactive accounts, then removing very old inactive accounts, and finally showing the results.
By default, sqawk doesn't modify input files. Use the --write flag to save changes back to the original files.
For more detailed information, see:
- User Guide - Complete guide to installing and using Sqawk
- SQL Language Reference - Comprehensive guide to Sqawk's SQL dialect
- In-Memory Database Architecture - Technical details about the database implementation (for developers)
Licensed under the MIT License (LICENSE or http://opensource.org/licenses/MIT).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be licensed as MIT, without any additional terms or conditions.