Using pipe character as a field separator

后端 未结 3 1643
无人共我
无人共我 2020-12-22 09:58

I\'m trying different commands to process csv file where the separator is the pipe | character.

While those commands do work when the comma is a separat

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-22 10:37

    You can escape the | as \|

    $ cat test
    hello|world
    $ awk -F\| '{print $1, $2}' test
    hello world
    

提交回复
热议问题