AWK as an Engineering Tool
On the [awkeng] page, there are links to some great AWK sites that offer much to introduce and explain AWK and offer AWK resources, and I will add little or nothing here to those explanations.
But, simply, AWK is a scripting language that was born of Unix and comes embedded in all Linux / Unix operating systems. It runs from the command line, and is very powerful in handling information in text files, but that alone is not what makes it attractive to engineering:
- It is supremely elegant in handling text and numbers. Commands are brief and powerful, and programs can be written in just a few lines of code; ironically, most of the script will deal simply with reading the input and printing the output.
- It's a scripting language, so you don't need a compiler, and the script file is readable, "commentable", editable ASCII text.
- The syntax is not all that cryptic (though many "code poets" do strive to write efficient but cryptic code). Certainly it is no harder than learning a spreadsheet "language". And, after 25 years of spreadsheets, I need a change of scenery.
- I am a "hobbyist" programmer, and learned enough AWK in eight hours to do day-to-day mechanical engineering stuff.
- Unlike compiled (binary) program files, when you give an awkscript to someone and they complain about it (which they must of course !), you simply smile and say "hey buddy, there's the script, do what you want with it".
And my best reason ....
- It is much easier to follow a list of annotated AWK commands than it is to hack your way through a spreadsheet that someone passed on to you with multiple sheets, a spider web of cell links ( to files that don't reside on your system !) and hidden macros. This makes AWK code highly transferrable and easily read and modified by the next owner.
AWKscripts for Mechanical Engineering
Tclforawk is a graphical interface for organizing and running groups of awkscripts. It is written in another scripting language - Tcl/Tk - that runs on any computer system. The script file is free to download, use and modify.
Page written by Dave Leo, updated Feb.01.2012
My e-mail address = (daveleo2010@verizon.net)