pidgeot-org / derrik

Derrik helps you move around data with confidence
MIT License
1 stars 0 forks source link

feat: add `filter` command #2

Closed masci closed 2 days ago

masci commented 2 months ago

Read one or more input files in jsonl format, filter out lines matching --what in the fields --where and write the output to the stdout or file passed with --output.

derrik filter \
    --what "keyword_to_match" \
    --where "some_field" "some_other_field" \
    --operator "icontains" \
    --output out.jsonl \
    *.jsonl.zstd

Nice to have (next steps):

luigigubello commented 1 month ago

--match "foo" "bar" "baz" == --march "foo OR bar OR baz"

--match-key "matched" should have the keys of the input JSON in which the values match our --match flag.

luigigubello commented 1 month ago

--match should accept just a vector of strings, we should have a different option to pass a file (e.g. --match-file matches.txt)

luigigubello commented 1 month ago

match is a taken keyword in Rust