Apply a function to one column only, with a variable location

后端 未结 1 894
梦如初夏
梦如初夏 2021-01-06 03:49

I have a bunch of different files. All files contain a column titled ID, but not necessarily in the same location in all of the files. I have a function I want to apply to

1条回答
  •  半阙折子戏
    2021-01-06 04:52

    Simple:

    $ awk -v column=$COLNUMBER '{ $column = FUNCTION($column); print }' $FILE
    

    0 讨论(0)
提交回复
热议问题