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 ArticlePrinting 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 ArticleExecutable 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 ArticleAccessing 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
More Pages to Explore .....