Notepad++ plugin
Query Files
Run SQL on CSV, Parquet, JSON and Excel files, directly from Notepad++. Open a file, choose Query this file, and query it as THIS.
Goal
Taking a quick look inside a data file usually means: open a database client, create a table, import, and only then write your query. Query Files skips all of that. The file you have open in Notepad++ becomes a table called THIS, and you just write SQL against it.
Under the hood runs DuckDB: modern SQL with window functions, QUALIFY, PIVOT and GROUP BY ALL, and fast enough for files with millions of rows. You can also query files on disk directly and join them, including wildcards such as 'logs/*.json'.
There already is a plugin that runs SQL on CSV (CSV Query), but it uses SQLite from 2011 and only handles CSV. Query Files is written in C++, uses a local duckdb.exe, and sends nothing over the internet. Source fully open (MIT license) on GitHub.
What to expect
Query this file
From an open CSV, Parquet, JSON or Excel file, a new SQL tab opens in which that file is called THIS. Unsaved changes in that tab are included too.
Run query in one click
A green ▶ button in the toolbar runs the selection or the whole document. Several statements in a row are fine; each result is listed below the previous one.
Text or table
Choose in Settings: results as text in a tab (with column types), or as a sortable table in a docked panel. Ctrl+C copies rows straight into Excel.
Join files
Query any file on disk: from 'orders.parquet' join 'customers.csv' using (customer_id). Relative paths are relative to your SQL file.
Describe and Summarize THIS
In one click the columns and types of an unknown file, or per column the min, max, number of NULLs and distinct values.
Errors on the right line
An error appears where the result would go, with the line number in your SQL. Long queries run in the background and can be cancelled.
See it in action
A query on an open CSV file, and the result as the plugin puts it in a tab.
Query
-- this: C:\data\orders.csv
select customer,
count(*) as orders,
sum(amount) as revenue
from this
group by all
order by revenue desc;Result
┌──────────┬────────┬─────────┐ │ customer │ orders │ revenue │ │ varchar │ int64 │ double │ ├──────────┼────────┼─────────┤ │ Alpha │ 3 │ 394.75 │ │ Beta │ 2 │ 122.75 │ │ Gamma │ 1 │ 15.0 │ └──────────┴────────┴─────────┘
THIS belongs to the plugin
THIS is a reserved word of Query Files and always read-only. Use it as a table (from this, join this t, describe this, copy this to 'out.parquet'), but not as a name: not as an alias, CTE or table name, and not as the target of insert, update or delete. A column that really is called this is written in double quotes.
Usage
1. Installation
Not yet in Notepad++'s Plugins Admin — manual install:
Download QueryFiles.zip from the latest release and unzip it into the Notepad++ plugin folder (64-bit Notepad++ required):
C:\Program Files\Notepad++\plugins\
QueryFiles\
QueryFiles.dll
help.txt2. DuckDB
Query Files uses the free duckdb.exe (duckdb.org). Put it on your PATH, next to the plugin, or pick it in Settings. Already using Datamodder File Tools with DuckDB? Then Query Files picks that one up automatically.
3. Activate plugin
Restart Notepad++. The plugin appears automatically under Plugins → Datamodder Query Files.
4. Get started
Open a data file, choose Query this file, and click the ▶ button in the toolbar:
Plugins → Datamodder Query Files → Query this file Plugins → Datamodder Query Files → Run query (▶)
Frequently asked questions
Is this plugin really free?
Yes, completely — MIT license, source open on GitHub, no ads, no 'pro' version behind a paywall. DuckDB is free and open source too.
Does the plugin send data over the internet?
No. Your queries run in the locally installed duckdb.exe, even without an internet connection. Only when you use an extension such as excel for the first time may DuckDB download it once.
How large can the files be?
DuckDB reads files directly and in parallel, so millions of rows are no problem. By default the plugin shows at most 1,000 rows of the result (configurable), so Notepad++ doesn't freeze.
How is this different from CSV Query?
CSV Query loads a CSV into SQLite 3.7 from 2011: no window functions, CSV only, only the open file. Query Files uses a current DuckDB, also reads Parquet, JSON and Excel, and can join files on disk.
Are tables kept between two runs?
Not by default: every run starts a fresh in-memory database. Set a database file (.duckdb) in Settings and your tables, views and macros are kept.
Which Notepad++ version do I need?
64-bit Notepad++ 8.3 or later. 32-bit is not supported.
Found a bug, or have an idea for an improvement?
Report it directly as an issue on GitHub — it gets read and followed up on. Prefer not to use GitHub? Send us a message through the contact form instead, and we'll pass it along.