Category Archives: Uncategorized

Linux is awesome v1

In part 1 of a (potentially) recurring series of posts on the subject, I learned the use of Linux’s awk command, that can be used to parse a text file and return textual tokens that occur after a specified input token.

The command is used as follows:

> cat textfile | awk -F “<input token text> ” ‘{print $2}’

Cat the textfile so its contents are scanned through. Then the awk command is given the <input token text>, such that it locates the token in each line of the file and tokenizes the remainder of the line. The part of the line preceding the token can be printed by {print $1} and the part after the token by {print $2}