Quantcast
Channel: awk – timmurphy.org
Browsing latest articles
Browse All 4 View Live

Replacing newline characters in linux

There are many linux tools available to do search and replace, with sed being one of the most commonly used. However, tools like sed work line-by-line. If you need to replace/remove newline characters...

View Article



Printing the nth word on each line using awk

There are many ways in the linux terminal to print the nth word of a given file or output. One way to do this without worrying about tabs, extra spaces or word length is to use awk. With awk, this can...

View Article

Executable awk scripts in Linux

Awk is a useful language for many command line tasks. Often awk is used on the command line on its own or with strings piped to it, but it is possible to turn that awk code into an executable script....

View Article

Accessing fields by index in Awk

In awk, fields are accessed by number; $1 for the first field, $2 for the second, etc. But sometimes the field number you want to access is not known until run time. In these cases, you can access the...

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images