orcli/help/search.md

43 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2023-10-27 23:12:16 +02:00
# orcli search
```
orcli search
apply regex to each column and print matches in flattened tsv format
output: index column value
2023-10-28 16:23:11 +02:00
note that any exporter supports search by using --facets (see examples)
2023-10-27 23:12:16 +02:00
Usage:
orcli search PROJECT [REGEX] [OPTIONS]
2023-10-27 23:12:16 +02:00
orcli search --help | -h
Options:
--index COLUMN
print column values instead of row.index in the first column of the output
2023-10-27 23:12:16 +02:00
--help, -h
Show this help
Arguments:
PROJECT
project name or id
REGEX
search term (regular expression, case-sensitive)
2023-10-27 23:12:16 +02:00
Examples:
orcli search "duplicates" "^Ben"
orcli search 1234567890123 "^Ben"
2023-10-28 16:23:11 +02:00
orcli search "duplicates" "^F" --index "email"
orcli search "duplicates" | column -t -s $' '
2023-10-28 16:23:11 +02:00
orcli export tsv "duplicates" --facets '[{ "type": "list", "expression":
"grel:filter(row.columnNames,cn,cells[cn].value.find(/^Ben/).length()>0).length()>0",
"columnName": "", "selection": [{"v": {"v": true}}] }]'
orcli export tsv "duplicates" --facets '[{ "type": "list", "expression":
"grel:filter([\"gender\",\"purchase\"],cn,cells[cn].value.find(/^F/).length()>0).length()>0",
"columnName": "", "selection": [{"v": {"v": true}}] }]'
2023-10-27 23:12:16 +02:00
```
code: [src/search_command.sh](../src/search_command.sh)