awk_examples
If you want to send us your comments, please do so. Thanks
More on comments
AWK Examples
for
Probably work with GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.5, GNU MP 6.1.2)
awk 'BEGIN { print sqrt(18/3) }' echo "0.4 0.7" | awk '{printf "%2.2f\n", $1 * $2}'
Find linenumber
awk '/string/{ print NR; exit }' file.txt awk 'match($0,v){print NR; exit}' v=string file.txt # With a variable
Replace characters
Built-in Variables: FS, OFS, RS, ORS, NF, NR, FNR, FILENAME
awk '{print $3,$2,$1}' RS="\n\n" FS="\n" OFS=";" somefile.txt
Main subjects on this wiki: Linux, Debian, HTML, Microcontrollers, Privacy
RSS
Disclaimer
Privacy statement
Bugs statement
Cookies
Copyright © : 2014 - 2024 Webevaluation.nl and the authors
Changes reserved.
awk_examples.txt · Last modified: 08-03-2022 22:25 by wim