LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

nth

extracts specific fields from input

TLDR

Extract nth field
$ echo "[a b c]" | nth [2]
copy
Extract from CSV
$ nth -d "," [1] < [file.csv]
copy
Extract multiple fields
$ nth [1] [3] [5] < [file.txt]
copy
Use custom delimiter
$ nth -d ":" [1] < [/etc/passwd]
copy

SYNOPSIS

nth [options] fields [file]

DESCRIPTION

nth extracts specific fields from input. Simple alternative to awk/cut.The tool handles field extraction efficiently. Cleaner syntax than awk.

PARAMETERS

FIELDS

Field numbers to extract (1-indexed).
-d DELIMITER
Field delimiter (default: whitespace).
-0
Use null as output separator.
--help
Display help information.

INSTALL

nix profile install nixpkgs#nth
copy

CAVEATS

Field numbering starts at 1. Simpler than awk but less powerful.

HISTORY

nth provides simple field extraction as an alternative to awk and cut.

SEE ALSO

cut(1), awk(1), paste(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid