(Video materials in preparation)
selr : Selects rows that match exactly
Usage : selr <field> <str> <file>
Option : --through <str>
Version : Tue Jan 9 09:02:34 JST 2024
Edition : 1
Outputs records from <file> where the specified field <field>
matches the specified string <str> exactly.
If <file> is omitted or equal to "-", data is read from stdin.
Only outputs rows where the specified field matches exactly.
$ cat data
0001 a
0002 b
0003 c
0004 c
$ selr 1 0001 data
0001 a
$ selr 2 c data
0003 c
0004 c
If you specify option --through <str> then if both <str> values are
the same all records are output unconditionally, while if the two
<str> values are different, the command executes normally as if
--through were not specified.
$ selr --through _ 2 _ data
0001 a
0002 b
0003 c
0004 c
$ selr --through _ 2 a data
0001 a