Use space as a delimiter with cut command

前端 未结 8 1170
[愿得一人]
[愿得一人] 2020-12-07 07:24

I want to use space as a delimiter with the cut command.

What syntax can I use for this?

8条回答
  •  半阙折子戏
    2020-12-07 08:15

    scut, a cut-like utility (smarter but slower I made) that can use any perl regex as a breaking token. Breaking on whitespace is the default, but you can also break on multi-char regexes, alternative regexes, etc.

    scut -f='6 2 8 7' < input.file  > output.file
    

    so the above command would break columns on whitespace and extract the (0-based) cols 6 2 8 7 in that order.

提交回复
热议问题