AWK

AWK is usually included in a Unix environment. This means that to run an awk script, all you need to do is to open a terminal an type in (or copy-paste) the code.

This scripting language can be extremely useful for text processing. Editing xml files becomes much faster if you use scripts to automatically generate the code. One example where we have made use of awk scripting is to speed up report design.

One simple example: imagine you need to generate 100 variables called 'variable1', 'variable2' … 'variable10'. This short code will do it for you in a matter of seconds:

awk '{for (i=1; i<=10; i++) 
{ printf "variable"i ", "} exit 1}'

variable1, variable2, variable3, variable4, variable5, variable6, variable7, variable8, variable9, variable10,


Creator: Julia Gusman on 2009/06/24 15:54
XWiki Enterprise 1.7.2.16857 - Documentation