Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # menampilkan kolom 3 dan 4
- awk '{print $3 "\t" $4}' marks.txt
- # prints all the lines that match pattern.
- awk '/a/ print:$0}' test.txt
- awk '/a/' tag.txt
- # prints the third and fourth field when a pattern match succeeds.
- awk '/a/ {print $3 "\t" $4}' test.txt
- # prints the fourth column followed by the third column.
- awk '/a/ {print $4 "\t" $3}' test.txt
- # print the number of lines for which a pattern match succeeded.
- awk '/a/{++cnt} END {print "Count = ", cnt}' test.txt
- # print only those lines that contain more than 18 characters.
- awk 'length($0) > 18' test.txt
- # replace ' (single quote)
- awk '{gsub( "[:'\'']","" ); print}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement