Bundle
In-memory query engine over typed columns. Tables are filled row by row or loaded from sources (CSV files, folders, the program's own objects) and queried with SQL-like statements; aggregates, Describe() and Finder (file search) are included. Compile with -lib query.
Finder
Finds files whose full path matches a regular expression, searching a folder and everything below it. Entries whose names start with '.' are skipped, and hidden folders are not entered.
Operations
FindFiles #
Finds matching files in a given directory
method : public : FindFiles(path:String) ~ Vector<String>Parameters
| Name | Type | Description |
|---|---|---|
| path | String | root directory to start searching |
Return
| Type | Description |
|---|---|
| Vector<String> | matching file names, as full paths |
Example
finder := Query.Structured.Finder->New(".*\\.json$"); # find JSON files
results := finder->FindFiles("/etc/");
each(i : results) {
results->Get(i)->PrintLine();
};FindTable #
Finds matching files as a view over the filesystem table, so the result can be filtered, sorted, grouped or joined. The rows are the files FindFiles returns; the columns are FilesystemSource's.
method : public : FindTable(path:String) ~ ViewParameters
| Name | Type | Description |
|---|---|---|
| path | String | root directory to start searching |
Return
| Type | Description |
|---|---|
| View | matching files, Nil if the pattern is invalid or the directory cannot be read |
Example
finder := Query.Structured.Finder->New(".*\\.obs$");
big := finder->FindTable("src")->Where(Col->Of("size")->Gt(10000))->OrderBy("size", Order->DESC);