Awk makes the assumption that its input is structured and not just an endless string of characters. In the simplest case, it takes each input line as a record and each word, separated by spaces or tabs, as a field. (The characters separating the fields are often referred to as .) The following record in the file has three fields, separated by either a space or a tab. Two or more consecutive spaces and/or tabs count as a single delimiter. Awk allows you to refer to fields in actions using the field operator . This operator is followed by a number or a variable that identifies the position of a field by number. "$1" refers to the first field, "$2" to the second field, and so on. "$0" refers to the entire input record. The following example displays the last name first and the first name second, followed by the phone number. $1 refers to the first name, $2 to the last name, and $3 to
Products & Services
Piezoelectric Drivers and Piezoelectric Amplifiers
Piezoelectric drivers and piezoelectric amplifiers are power sources that provide the high voltage levels needed to drive other piezoelectric devices such as actuators, motors, transducers, and sensors.
Logic gates are electronic circuits that combine digital signals according to boolean algebra.
Linear motors generate force only in the direction of travel. They are capable of extremely high speeds, quick acceleration, and accurate positioning.
Electrically erasable programmable read-only memory (EEPROM) chips are similar to PROM devices, but require only electricity to be erased.
Topics of Interest
This section summarizes how awk processes input records and describes the various syntactic elements that make up an awk program. Each line of input is split into fields. By default, the field...
There are a number of system or built-in variables defined by awk. Awk has two types of system variables. The first type defines values whose default can be changed, such as the default field and...
The built-in string functions are much more significant and interesting than the numeric functions. Because awk is essentially designed as a string-processing language, a lot of its power derives from...
There are three versions of awk whose source code is freely available. They are the Bell Labs awk, GNU awk, and mawk, by Michael Brennan. This section discusses the extensions that are common to two...
There are also several commercial versions of awk. In this section, we review the ones that we know about. Mortice Kern Systems (MKS) in Waterloo, Ontario (Canada) supplies awk as part of the MKS...