In AWK, is it possible to specify “ranges” of fields??

In AWK, is it possible to specify "ranges" of fields? Example. Given a tab-separated file "foo" with 100 fields per...

Printing the last column of a line in a file?

I have a file that is constantly being written to/updated. I want to find the last line containing a particular word...

Using awk to count the number of occurrences of a word in a column?

03/03/2014 12:31:21 BLOCK 10.1.34.1 11:22:33:44:55:66 03/03/2014 12:31:22 ALLOW 10.1.34.2 AA:BB:CC:DD:EE:FF 03/03/...

How to get the second column from command output??

My command's output is something like: 1540 "A B" 6 "C" 119 "D" The first column is always a number, followed...

How to split a delimited string into an array in awk??

How to split the string when it contains pipe symbols | in it. I want to split them to be in array. I tried echo "...

Select a particular column using awk or cut or perl?

I have a requirement to select the 7th column from a tab delimited file. eg: cat filename | awk '{print $7}' The ...

Printing the last column of a line in a file?

I have a file that is constantly being written to/updated. I want to find the last line containing a particular word...

Get last field using awk substr?

I am trying to use awk to get the name of a file given the absolute path to the file. For example, when given the in...

unix tr find and replace?

This is the command I'm using on a standard web page I wget from a web site. tr '<' '\n<' < index.html h...

How can I replace a newline with its escape sequence??

Using sed to make text that contains certain characters suitable for use in string literals is straightforward: sed...