tuc
Cut text (or bytes) where a delimiter matches, then keep the desired parts. tldr-pages
On several platforms
Several platforms
Cut text (or bytes) where a delimiter matches, then keep the desired parts. A more user-friendly and powerful version of cut with sensible defaults.
Cut and rearrange fields
echo "foo bar baz" | tuc --delimiter ' ' --fields 3,2,1IdentifyReplace the delimiter space with an arrow
echo "foo bar baz" | tuc --delimiter ' ' --replace-delimiter ' ➡ 'IdentifyKeep a range of fields
echo "foo bar baz" | tuc --delimiter ' ' --fields 2:IdentifyCut using regex
echo "a,b, c" | tuc --regex '[, ]+' --fields 1,3IdentifyEmit JSON output
echo "foo bar baz" | tuc --delimiter ' ' --jsonIdentify