awk and special brackets delimiters

前端 未结 4 550
春和景丽
春和景丽 2020-12-18 10:27

I have data in the following format:

.......{INFO1}.....[INFO2]....

For awk it should be really simple to pick up the IN

4条回答
  •  不思量自难忘°
    2020-12-18 10:59

    You just have to add {} to the field separator:

    ~$ echo ".......{INFO1}.....[INFO2]...." | awk -F'[][{}]' '{print $2,$4}'
    INFO1 INFO2
    

提交回复
热议问题