Top "Awk" questions

AWK is an interpreted programming language designed for text processing and typically used as a data extraction and reporting tool.

Trim leading and trailing spaces from a string in awk

I'm trying to remove leading and trailing space in 2nd column of the below input.txt: Name, Order   Trim, working …

shell unix awk
Select row and element in awk

I learned that in awk, $2 is the 2nd column. How to specify the ith line and the element at the …

awk
Append file contents to the bottom of existing file in Bash

Possible Duplicate: Shell script to append text to each file? How to append output to the end of text file …

bash sed awk append
find difference between two text files with one item per line

I have two files: file 1 dsf sdfsd dsfsdf file 2 ljljlj lkklk dsf sdfsd dsfsdf I want to display what is …

bash file scripting sed awk
How can I quickly sum all numbers in a file?

I have a file which contains several thousand numbers, each on it's own line: 34 42 11 6 2 99 ... I'm looking to write a script …

linux perl bash shell awk
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. …

unix awk substr
Use awk to find average of a column

I'm attempting to find the average of the second column of data using awk for a class. This is my …

bash awk
How to add to the end of lines containing a pattern with sed or awk?

Here is example file: somestuff... all: thing otherthing some other stuff What I want to do is to add to …

bash sed awk
How to select lines between two marker patterns which may occur multiple times with awk/sed

Using awk or sed how can I select lines which are occurring between two different marker patterns? There may be …

shell unix sed awk pattern-matching
How to use awk sort by column 3

I have a file (user.csv)like this ip,hostname,user,group,encryption,aduser,adattr want to print all column …

awk