Quantifiers in a regular expression used with awk behave unexpected

后端 未结 2 1875
陌清茗
陌清茗 2021-01-21 20:16

I want to process this list: (Of course this is just an excerpt.)

    1   S3 -> PC-8-Set
    2   S3 -> PC-850-Set
    3   S3 -> ANSI-Set
    4   S3 ->         


        
2条回答
  •  太阳男子
    2021-01-21 20:26

    Try

    awk --re-interval -F '[[:blank:]]{1,}' '{printf ("%s ", $2)}' list
    

    --re-interval

    Allow interval expressions (see Regexp Operators) in regexps. This is now gawk's default behavior. Nevertheless, this option remains both for backward compatibility, and for use in combination with the --traditional option.

提交回复
热议问题