Skip to content

Instantly share code, notes, and snippets.

@travishen
Created June 28, 2021 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save travishen/95b8a4bd3fd383f657c25cf4c6918822 to your computer and use it in GitHub Desktop.
Save travishen/95b8a4bd3fd383f657c25cf4c6918822 to your computer and use it in GitHub Desktop.
常見模式 說明
NF == 0 選定空紀錄
NF > 3 選定有三個字段以上的紀錄
NR < 5 選定第 1 至第 4 筆紀錄
(FNR==3) && (FILENAME ~ /[.][ch]$/) 從來源文件選定紀錄 3
$1 ~ /jones/ 選定字段 1 包含 jones 的紀錄
(FNR == 3), (FNR == 10) 選定每個輸入文件的第 3 至第 10 筆紀錄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment