[关闭]
@veightz 2018-05-27T17:56:20.000000Z 字数 682 阅读 975

awk notes

awk


自定义分隔符

  1. $ awk -F ','

从外部文件读取处理脚本

  1. $$$ awk -f awk_handler

变量名

   CONVFMT
          conversion format used when converting numbers (default %.6g)

   FS     regular expression used to separate fields; also settable by option -Ffs.

   NF     number of fields in the current record

   NR     ordinal number of the current record

   FNR    ordinal number of the current record in the current file

   FILENAME
          the name of the current input file

   RS     input record separator (default newline)

   OFS    output field separator (default blank)

   ORS    output record separator (default newline)

   OFMT   output format for numbers (default %.6g)

   SUBSEP separates multiple subscripts (default 034)

   ARGC   argument count, assignable

   ARGV   argument array, assignable; non-null members are taken as filenames

   ENVIRON
          array of environment variables; subscripts are names.
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注