Skip to main content

Module key

Module key 

Source

Structs§

KeyDef
A parsed key specification from -k START[,END].
KeyOpts
Key definition parsing and field extraction for sort -k.

Functions§

extract_key
Extract the key portion of a line based on a KeyDef. Allocation-free: uses find_nth_field instead of collecting all fields.
extract_key_z
Extract key with zero-terminated mode support. When zero_terminated is true and separator is None (default blank splitting), newlines are treated as blanks, matching GNU sort -z behavior.