answersLogoWhite

0

What are Nawk scripts?

Updated: 12/14/2022
User Avatar

Wiki User

15y ago

Best Answer

Nawk is an Awk replacement on *nix operating systems. It is very good at sorting data in columns and search functions. A classic awk command would be:

"$awk '/Home/ {print $3}' file > home.txt"

this consists of calling the awk interpretor to open the file "file", telling it to search for the word "Home" and when it finds that, print the 3rd column from that line out to a file named home.txt.

Awk automatically uses tab (\t) as the field separator ($FS) and you can change this if the input file uses something else besides the tab, e.g. : or ; or & and so on. there are a lot of awk tutorials on the web and most are pretty good.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are Nawk scripts?
Write your answer...
Submit
Still have questions?
magnify glass
imp