User Tools

Site Tools


awk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
awk [2013/04/27 15:52] – created javapimpawk [2023/08/18 18:15] (current) – external edit 127.0.0.1
Line 4: Line 4:
 $ echo "abc:def:ghi" | awk -F':' '{print $3}' $ echo "abc:def:ghi" | awk -F':' '{print $3}'
 ghi ghi
 +</code>
 +
 +====== Find and Replace with Incrementing Value ======
 +
 +<code bash>
 +$ awk 'BEGIN {i = 0;}{ gsub(/([a-zA-Z0-9_]+)/, "foo"i++); print $0}' test.txt > out.txt
 </code> </code>
awk.1367077947.txt.gz · Last modified: 2023/08/18 18:15 (external edit)