Linux command
tsv-filter 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Filter by column value
tsv-filter --eq [1]:[value] [file.tsv]
Greater than
tsv-filter --gt [2]:[100] [file.tsv]
String contains
tsv-filter --str-in-fld [1]:[pattern] [file.tsv]
Multiple conditions
tsv-filter --ge [2]:[10] --le [2]:[100] [file.tsv]
Invert filter
tsv-filter --invert --eq [1]:[value] [file.tsv]
说明
tsv-filter selects rows from tab-separated value files based on column conditions. It supports both numeric comparisons (equal, greater than, less than) and string operations (contains, exact match), allowing precise filtering of structured data. Multiple conditions can be combined, and they are joined with AND logic by default — all conditions must match for a row to be included. The --invert flag reverses the selection to output non-matching rows instead. Part of the tsv-utils suite, tsv-filter is written in D for high performance on large datasets. Column numbers are 1-based, and the -H flag enables header-aware processing.
参数
- --eq _COL:VAL_
- Equal to value.
- --gt _COL:VAL_
- Greater than.
- --lt _COL:VAL_
- Less than.
- --str-in-fld _COL:PAT_
- String contains.
- --invert
- Invert match.
- -H
- Has header.
FAQ
What is the tsv-filter command used for?
tsv-filter selects rows from tab-separated value files based on column conditions. It supports both numeric comparisons (equal, greater than, less than) and string operations (contains, exact match), allowing precise filtering of structured data. Multiple conditions can be combined, and they are joined with AND logic by default — all conditions must match for a row to be included. The --invert flag reverses the selection to output non-matching rows instead. Part of the tsv-utils suite, tsv-filter is written in D for high performance on large datasets. Column numbers are 1-based, and the -H flag enables header-aware processing.
How do I run a basic tsv-filter example?
Run `tsv-filter --eq [1]:[value] [file.tsv]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --eq _COL:VAL_ do in tsv-filter?
Equal to value.