Adler32Checksum
As documented in the [[http://en.wikipedia.org/wiki/Adler-32 | Adler-32 Wikipedia article]]. {{{ awk . . . precision, but # if we use these names and these values we make it easy for the # curious ones to search . . . b = (b?b:0); i = 0; j = MAX_BLOCK # We allow the values of a and b to be overridden by the caller # . . . is also a hidden assumption here that the # value of i always starts off as less than j and # climbs . . .
4K - last updated 2008-12-31 12:05 UTC by pgas
AllAboutGetline
//Editor's notes: The article was originally posted on the comp.lang.awk newsgroup, and can still be . . . update $0 and $NF so they will have a different value for subsequent processing than they had for prior . . .
16K - last updated 2009-02-15 22:14 UTC by waldner
arithmetic
The [[awk]] programming language provides a set of [[dyadic]] arithmetic operators for performing basic . . . arithmetic on [[integer]] and [[floating point]] values. | *Operator* | *Description* | + | [[addition]] . . .
1K - last updated 2011-05-24 22:16 UTC by markhobley
ArrayLength
Posix does not define a way to get the length of an array, while you could use a loop to count the elements . . . of a is %d\n",n #remember that split returns a value n=split("foo bar",a) printf "the length of a . . .
2K - last updated 2009-02-09 09:45 UTC by arnold.robbins
assign
== The assignment operator == In [[awk]], as with most other programming languages, the *equals sign* . . . *assignment [[operator]]* assigning the value of the [[expression]] of the right hand [[operand]] . . . to a variable count = 5 # assign a numeric value to a variable }}} == Multiple assignments == . . .
1K - last updated 2010-11-28 18:17 UTC by markhobley
awk1page
an awk program is a series of //pattern { actions }// statements;\\ ie if the input line matchs pattern . . . } END { print sum } }}} To also find the maximum value of field $1: {{{awk { sum = sum + $1 } $1 > . . . { max = $1 } END{ print "sum = " sum; print "max value = " max; } }}} For terse concise summary see:\\ . . .
2K - last updated 2012-03-18 22:22 UTC by g0pher
AwkDc
This is an awk implementation of the [http://www.gnu.org/software/bc/manual/dc-1.05/html_mono/dc.html|dc] . . . being an implementation-dependent value (though most likely 2^52); # integration of the . . . function to check # for integer values? This facility is used in at # least two places . . . ensure that exponent and modulus are # integer values! (is that worth doing now?) _dc_put(stk, (base . . . operator # dispatch table and stuffing string values # directly onto the stack via putstring(). {for . . .
12K - last updated 2008-07-17 14:47 UTC by gnomon
AwkFeatureComparison
This page lists which awk implementations support which features. Additions and corrections are very . . . mode|yes|no|no|no|unknown|no|no|no| |=-v to pass values|yes|yes|yes|yes|yes|yes|unknown|yes|yes|yes| . . . 'NR==1{print RT}' # 4}}}| |=-v to pass values|{{{awk -v foo=bar 'BEGIN {print foo}' # bar}}} . . .
4K - last updated 2015-04-27 13:23 UTC by pgas
AwkGuide
** Work in Progress ** {{{ import from Mark Hobley's wiki }}} <toc> ---- == Overview * [[Overview]] . . . [[truth]] * [[typecast]]ing * [until loop]s * [[value]]s * [[variable]]s * variable [[assign]]ment . . .
4K - last updated 2011-08-14 15:57 UTC by markhobley
AwkOnWindowsHowto
AwkOnWindowsHowto\\ rough cut - needs edit {{{ 3) awk command line switches/usage from a win32 cmd.exe . . . > awk95.exe usage: awk95.exe [-F fs] [-v var=value] [-f progfile | 'prog'] [file ...] -version or . . . from stdin -F fs set field separator FS to value of fs (nojoy -F "" to set FS to null; use -v . . . FS="") -v var=value -v a=1 to be done NOW. one -v for each variable . . . (\a \v \xhh Not interpreted in value; use octal \nnn instead) -d[n] undocumented -d . . .
3K - last updated 2010-10-24 07:44 UTC by g0pher
AwkTips
<toc> ---- == Be idiomatic! In this paragraph, we give some hints on how to write more idiomatic . . . even use "42", or "19", or any other nonzero value if you want; "1" is just what people traditionally . . . regardless of how many files have been read. The value of NR starts at 1 and always increases until . . . //from the current file being processed//. The value of FNR starts from 1, increases until the end . . . range or not, and print lines based on the value of the flag. Let's see how it's done: {{{ # prints . . .
31K - last updated 2009-03-24 16:54 UTC by waldner
calling section
A '''calling section''' is a section or [[block]] of code that makes a call to a subroutine or [[function]]. . . . has returned. == Evaluation of return values == The code at the return point within a program . . .
1K - last updated 2011-05-06 21:57 UTC by markhobley
CAWKLib
=CAWKLib CAWKlib is a library of functions for for awk intended to be used with preprocessors/wrappers . . . of an array (meaning the number of elements/values/indices) *ary_width() -- return the width of . . .
5K - last updated 2015-01-29 10:14 UTC by 108-243-116-77.lightspeed.cicril.sbcglobal.net
command line parameter
The [[awk]] extraction and reporting language uses traditional conventions for accessing command line . . . "Argument " l " is " ARGV[l] } } }}} === The value of ARGV[0] is unreliable and varies across systems . . .
1K - last updated 2011-06-25 05:49 UTC by pgas
comparative operator
The comparative operators are used to determine equality or inequality or otherwise make comparisons . . . of numeric or string values, and produce a boolean truth based on the result. . . . A true comparison evaluates to a value of one, whereas a false comparision evaluates . . . comparisons of strings containing numeric values may cause unexpected results because whether . . . be treated as conventional strings or numeric values depends on how the values were obtained, and . . .
3K - last updated 2013-02-24 17:38 UTC by markhobley
compound assignment operator
The *compound assignment operators* (also called *combination assignment operators*) provide a more concise . . . included in the right hand [[operand]]. {{{ $value += 3; # $value = $value + 3 $value /= 3; # $value . . . = $value / 3 }}} === Arithmetic === | += | [[addition]] . . .
2K - last updated 2011-03-27 09:46 UTC by markhobley
concatenation
== The awk programming language does not have an explicit concatenation operator == The awk programming . . . Note that [[whitspace]] is allowed between the [[value]]s: {{{ awk BEGIN { name = "Bob" print "Hello . . . " name } }}} === Numeric values will be concatenated as strings === Note that . . . concatenation of [[numeric]] values will occur if [[whitespace]] is used between . . . so unexpected results may occur, if numeric [[value]]s are represented this way within an [[expression]]: . . .
1K - last updated 2011-06-25 05:13 UTC by pgas
ConcatenationPrecedence
You'd expect `6 -22', but you get `6-22'. It's because the `" " -22' is grouped first, as a substraction . . . of a concatenation, resulting in the numeric value `-22'; then it is concatenated with `6', giving . . .
1K - last updated 2008-12-15 12:37 UTC by pgas
ConvertHexToFloatingPoint
This code uses [[gawkism|gawk specific features]], such as the [[http://www.gnu.org/manual/gawk/html_node/Strtonum-Function.html][strtonum]] . . . at the # individual bits and compute the base 10 value decfrac=0 for(i=22;i>=0;i--) { if( and( fraction . . .
3K - last updated 2010-06-23 19:49 UTC by john b
division
== Quotient Division == The [[slash]] symbol can be used as the division [[operator]] to produce the . . . used to perform a quotient division calculation: value /= 3 # value = value / 3 == Integer Division . . .
2K - last updated 2011-03-20 07:07 UTC by markhobley
dollarint
A [[dollar]] sign and followed by an [[integer]] are used to refer to [[field]]s within the current [[record]]: . . . important. # Without parentheses, we would get a value 2 more than field 3 }}} == A dollar sign followed . . . {{{ awk { $2 = 23 } # Change field two to a value of 23 }}} == See also == * [[NF|Number of fields]] . . .
3K - last updated 2011-06-25 05:28 UTC by pgas
enumeration
The [[awk]] extraction and reporting language does not directly support enumeration. However, it is possible . . . In the following example we enumerate the values for a set of fruit names: {{{ BEGIN { n=1 # . . . We are enumerating from a value of one apple=++n banana=++n cherry=++n # We give . . . raspberry an explicit value of eighteen n=raspberry=18 } }}} . . .
1K - last updated 2011-05-27 15:28 UTC by markhobley
ENVIRON
Modern versions of new awk (gawk, mawk, Bell Labs awk, any POSIX awk) all provide an array named ENVIRON. . . . is indexed by environment variable name; the value is that variable's value. For instance, ENVIRON["HOME"] . . . be "/home/chris". To print out all the names and values, use a simple loop: {{{ awk for (i in ENVIRON) . . . this is less pretty, and may be a problem if the values contain newlines: {{{ awk # test this on your . . . ("env" | getline line) >0 ) { varname=line varvalue=line sub(/=.*$/,"",varname) sub(/^[^=]*=/,"",varvalue) . . .
1K - last updated 2008-11-19 13:13 UTC by pgas
ENVIRONJapanese
Modern versions of new awk (gawk, mawk, Bell Labs awk, any POSIX awk) all provide an array named ENVIRON. . . . is indexed by environment variable name; the value is that variable's value. For instance, ENVIRON["HOME"] . . . be "/home/chris". To print out all the names and values, use a simple loop: {{{ awk for (i in ENVIRON) . . . this is less pretty, and may be a problem if the values contain newlines: {{{ awk # test this on your . . . ("env" | getline line) >0 ) { varname=line varvalue=line sub(/=.*$/,"",varname) sub(/^[^=]*=/,"",varvalue) . . .
1K - last updated 2008-11-24 08:05 UTC by pgas
environment
The ENVIRON [[associative container]] contains the values of the current environment. This enables an . . .
1K - last updated 2011-06-07 01:05 UTC by markhobley
EnvVarGeneral
**Answer 1:** On Unix, use "alternate quoting", e.g. {{{ awk -F: '$1 ~ /'"$USER"'/ {print $5}' /etc/passwd . . . complete discussion of passing shell variables values to awk programs. . . .
3K - last updated 2011-07-05 09:31 UTC by pgas
escape sequence
Some characters cannot be included in [[literal string]]s, because they are [[nonprintable]] or [[control . . . the following notation: | \ddd | dd is an octal value | \xhh | hh is a hexadecimal value *This article . . .
3K - last updated 2008-12-30 13:07 UTC by Mark Hobley
ExitCode
Normally, the `exit' command exits with a value of zero. You can supply an optional numeric value to . . . the `exit' command to make it exit with a value: {{{ awk if (whatever) exit 12; }}} If you have . . . immediately; if you had previously supplied a value, that value is used. But, if you give a new value . . . to `exit' within the END block, the new value is used. This is documented in the GNU Awk User's . . .
1K - last updated 2008-11-26 12:30 UTC by pgas
exponent
==Warning! The use of [[gawkism]]s will prevent the script from running correctly on systems that use . . . a dyadic exponent [[operator]]. It returns the [[value]] given as a left [[operand]] to the power of . . . The [[operand]]s can be [[floating poin]]t values, producing a [[floating point]] value: {{{awk . . . used to perform an exponent calculation: {{{awk value **= 3 # value = value ** 3 }}} . . .
2K - last updated 2012-03-20 07:33 UTC by g0pher
field reference
== The field reference operator == The [[dollar]] symbol acts as a unary *field reference operator* and . . . important. # Without parentheses, we would get a value 2 more than field 3 }}} === Referencing a non . . . field zero gives the entire record === If a value of [[zero]] is given as the [[argument]] following . . . field: {{{ { $2 = 23 } # Change field two to a value of 23 }}} . . .
2K - last updated 2011-06-28 09:12 UTC by markhobley
FieldReference
$ is the "field reference" operator in AWK. It references the field in the current input record given . . . some further examples: {{{ # print both the value of i, and the field at $i.. print i, $i; # print . . .
1K - last updated 2009-01-03 01:51 UTC by fcr
FileAndBitJoinClone
== Problem Description This was difficult to hash out. Eventually the task was described as, "for each . . . value in $3 of file.txt, print out the line from bit.txt . . . = "file.txt" ERRSTR = "Guarantee violated, no value for %s in %s (%s, line %s)\n" while ((getline . . .
7K - last updated 2009-03-08 16:26 UTC by waldner
FindAllIndices
Sometimes it is useful to find the index of every occurrence of a given character in a string. Let's . . . of every doublequote character; # perform a values-to-keys inversion on the preceding array so . . .
2K - last updated 2011-07-05 10:53 UTC by pgas
FIXES
[[FIXES]] revised: . . . always 0 and the array is not set.\\ \\ values of $0 et al are preserved in the END block.\\ . . . new escapes \a \v \xhh are nojoy from the -v var=value\\ (although . . .
6K - last updated 2014-01-15 23:17 UTC by g0ph3r
FS
= Field Separator = The [[special variable]] FS is a field separator that is used to determine how [[awk]] . . . The single space field separator == The default value for the field separator is a single space character. . . . === Special behaviour === ==== The empty string value ==== The behaviour of the awk interpreter when . . .
5K - last updated 2013-02-19 21:45 UTC by markhobley
GoogleSearch
<form action="http://www.google.com/cse" id="cse-search-box"> <div> <input type="hidden" . . . name="cx" value="017112793247757597833:64jet7vbe1e" /> <input . . . type="hidden" name="ie" value="UTF-8" /> <input type="text" name="q" . . . /> <input type="submit" name="sa" value="Search" /> </div> </form> <script . . .
1K - last updated 2008-06-13 20:44 UTC by pgas
HomePage
This wiki is maintained by regulars from the **#awk** channel on **[[https://libera.chat/|irc.libera.chat]]** . . . reverse the mapping of keys -> values in an array === gawk specific code snippets . . .
5K - last updated 2023-06-26 04:15 UTC by HappMacDonald
if
The if [[condition]]al construct allows a [[statement]] or [[block]] of code to be [[condition]]ally . . . if the [[expression]] evaluates to a [[true]] value. The if [[condition]] its simplest form is: == . . . to be conditionally executed depending on the value of a boolean expression. {{{ if (EXPRESSION) . . .
2K - last updated 2011-09-11 21:43 UTC by 92.40.253.171.threembb.co.uk
index
== Usage == === index [ STRING, SUBSTRING ] === The index [[function]] is used to locate the first occurrence . . . If the [[substring]] cannot be found, then a value of [[zero]] is returned: BEGIN { print index("Staffordshire","ford") . . .
1K - last updated 2011-06-09 20:36 UTC by markhobley
iterative loop
An '''iterative loop''' repeatedly executes a set of instructions as the [iterator] steps through a series . . . of values. Types of iterative loops include [for] loops . . . a [block] of instructions against an [iterator] value. The [block] containing the [print] statement . . . This causes the loop to exit, when the [value] of l reaches 10: for (l= 0; l <= 9; l++) . . . statement, l++ in the above example causes the value of l to [increment] on each iteration of the . . .
2K - last updated 2011-08-13 21:00 UTC by markhobley
LargestAccurateNumber
Most [[awk]] implementations use floating point double precision to represent every kind of numeric value. . . . out a list of numbers. The largest reliable value that this process finds for my instance of gawk . . . are 0, the fraction is a 52-bit unsigned integer value. (Unsigned because the sign bit gives the overall . . . provide it. This means that with an exponent value of 1, you can continue getting precise values . . . 53 bits wide (2^53-1). Starting with an exponent value of 2, however, you lose precision as N and N+1 . . .
3K - last updated 2013-04-12 14:52 UTC by ttmrichter
LevenshteinEditDistance
The [http://en.wikipedia.org/wiki/Levenshtein_distance|Levenshtein edit distance] calculation is useful . . . The plan is to compute and retain only those values that are necessary to calculate the edit distance, . . .
6K - last updated 2010-04-16 10:19 UTC by pgas
libmawk
libmawk is a fork of [[mawk]], designed for embedding in C programs. Compare and contrast with [[awka]]. . . . using call() and acall()) ** dynamic variable value fetch (valueof() returns the value of a variable . . .
2K - last updated 2012-01-16 09:07 UTC by lewellyn
literal characters
== Special characters cannot be directly included in a literal string == Special characters, such as . . . cannot be included directly in a [[string]] value. This is because these [[character]]s have a . . .
2K - last updated 2010-11-28 19:14 UTC by markhobley
logical operator
In [[awk]], *logical operators* are used to perform [[boolean]] operations, and a return a value of [true] . . . or [false], depending on the values of the [operand]s. | *Operator* | *Symbol* | . . . The [[logical]] operators return a [[boolean]] value of 0 for [[false]], and 1 for [[true]]. In [[awk]], . . .
3K - last updated 2009-01-02 11:13 UTC by pgas
LshalOutputParser
=== Problem Specification 10:50 <Thanatermesis> i want to obtain the model of the disk, for example, . . . { split("", PROPERTIES) # delete all values in the PROPERTIES array split("", PROPORDER) . . .
3K - last updated 2008-06-27 16:22 UTC by gnomon
modulus
The [[dyadic]] modulus [[operator]], represented by a [[percent]] sign is used to return the remainder . . . determine the modulus of a division calculation: value %= 3 # value = value % 3 . . .
1K - last updated 2011-06-07 00:41 UTC by markhobley
multiplication
== Multiplication Operator == The multiplication operator represented by the star symbol, is used as . . . can also be used to perform a multiplication: value *= 3 # value = value * 3 . . .
1K - last updated 2011-04-17 06:32 UTC by markhobley
nudge operator
The *nudge operators* can be used to [[increment]] or [[decrement]] the value of their [[operand]]s, . . . 5 but number is 4 }}} == Nudging floating point values When used against floating point values, the . . . to add or subtract one to obtain a return value: {{{ number = 5.4 result = ++number # result . . . strings will evaluated as traditional numerical values In awk, numerical strings will evaluated as . . . normal numeric values within an expression, so the nudge operators . . .
3K - last updated 2011-03-20 13:18 UTC by markhobley
number
== _Numbers can be expressed as integers or floating point values_ In [[awk]], numbers can be expressed . . . as decimal [integer]]s or as [[floating point]] values. == _Numbers should be specified in decimal_ . . . in non [[decimal]] bases. However numerical values in [[output]] can be formatted into [[octal]] . . .
1K - last updated 2011-03-06 22:33 UTC by markhobley
numeric strings
Numeric strings obtained from the input source, will be treated as numeric values, when compared with . . . other strings containing numeric values. Strings valued defined as constants using doublequote . . . The behaviour of the operators when one value is considered to be numeric (eg from the input . . . source), but the other value has been defined explicitly as a numeric string . . . { if (a == b) { print "Comparison A: == The values are equal" } if (a != b) { print "Comparison . . .
5K - last updated 2013-02-24 17:40 UTC by markhobley
operator
The [[awk]] programming language provides a series of *operators* that allow [[value]]s and [[variable]]s . . . These operators can combined together with [[value]]s and [[variable]]s to make [[expression]]s. . . . acts as a [[dyadic]] operator, [[assign]]ing the value of the [[expression]] of the right hand [[operand]] . . .
3K - last updated 2011-05-24 22:19 UTC by markhobley
PassingAShellVariable
The common solution is to use the -v option to define an awk variable giving it the value of the shell . . .
1K - last updated 2009-01-30 08:36 UTC by pgas
PassingVariablesToTheParentProcess
How can I put values into the environment of the program that called my awk program? Short answer, you . . . {{{ awk 'BEGIN { printf("NEWVAR='%s'\n", somevalue) }' > /tmp/awk.$$ . /tmp/awk.$$ # sh/ksh/bash/pdksh/zsh . . . {{{ eval `awk 'BEGIN { print "NEWVAR=" somevalue }'` }}} Csh syntax and more robust use of quotation . . .
1K - last updated 2008-11-19 07:45 UTC by pgas
PassingVariablesToTheParentProcessJapanese
How can I put values into the environment of the program that called my awk program? Short answer, you . . . {{{ awk 'BEGIN { printf("NEWVAR='%s'\n", somevalue) }' > /tmp/awk.$$ . /tmp/awk.$$ # sh/ksh/bash/pdksh/zsh . . . {{{ eval `awk 'BEGIN { print "NEWVAR=" somevalue }'` }}} Csh syntax and more robust use of quotation . . .
1K - last updated 2008-11-24 08:05 UTC by pgas
pattern
In [[awk]], patterns are used to select lines of input for processing. The pattern within each [[rule]] . . . "Hello"} # This will not cause output, because a value of zero is considered to be false 1 {print "Goodbye"} . . . # This will cause output, because a value of one is considered to be true }}} === Omission . . .
2K - last updated 2011-05-19 18:18 UTC by markhobley
precedence
The [[awk]] programming language uses rules of *precedence* to determine the order in which [[operator]]s . . . result of 35. However, this actually produces a value of 23, because [[multiplication]] has a higher . . . following example, the [[expression]] produces a value of 35, because the [[parentheses]] have a higher . . . == _Side Effects_ An expression that changes the value of one of its components during evaluation, may . . . code, the [[awk]] interpreter may produce a value of 8 or 9, depending on whether or not the [[assignment]] . . .
7K - last updated 2013-04-11 06:58 UTC by markhobley
PrimeNumberSieve
This is the standard sieve of Eratosthenes implemented in portable awk. The running time of the bare . . . is that the former uses awk's fields to store values and the latter uses a standard array. The point . . .
4K - last updated 2008-06-19 05:56 UTC by gnomon
print
== Usage == === print [ LIST ] === The [[variadic]] **print** function is used to produce simple standardized . . . list. == Examples == print "Hello" == Default value == If the print function is given no [[argument]] . . .
1K - last updated 2011-05-11 15:10 UTC by markhobley
qse
Not a standalone awk, but an interesting library embedding an awk interpreter, from [[https://groups.google.com/group/comp.lang.awk/browse_thread/thread/b02c0d75e49eab75/54fc2c6316d657bc?lnk=gst&q=c%2B%2B+embed#54fc2c6316d657bc| . . . variables and functions. * getting and set the value of a global variable. * calling a function with . . . or without parameters and getting its return value. * customizing I/O handlers for file, pipe, console . . . (rtx, retv); /* destroy the return value */ ret = 0; oops: if (rtx) qse_awk_rtx_close . . . the BEGIN, pattern-action, END blocks. MyAwk::Value r; if (awk.loop (&r) <= -1) FAIL (awk); . . .
4K - last updated 2011-10-27 06:25 UTC by pgas
RangeOfFields
Printing a range of fields - all fields but the first, for examples, or fields 3 through 8 - is a surprisingly . . . the above two techniques, using the appropriate values for the repetition operator. Keep in mind that . . .
10K - last updated 2015-09-08 09:52 UTC by pgas
record
The awk utility divides its [[input]] into records and [[field]]s. == By default, each line of input . . . separator]] character. This has a default value of [[newline]], which is why [[awk]] treats each . . . change the record separator == By changing the value of the [[RS|record separator]], it is possible . . .
1K - last updated 2011-05-17 23:52 UTC by markhobley
regular expression operator
The [[awk]] programming language provides a set of *regular expression operators* that have special meanings . . . to the left hand operand and return a truth value depending on whether or not a match was found. . . . * ~ Returns a value of true if the regular expression matches the . . .
2K - last updated 2013-02-19 14:06 UTC by markhobley
return
The [[builtin]] '''return''' [[command]], can be used to exit from a [[function]] within the [[awk]] . . . an [[expression]] that evaluates to a [[return value]] that is to be made available to the [[calling . . . section]]. === Using the return value command to set an errorlevel === By convention, . . . exits normally it should give a [[return value]] of zero: return 0 # Function completed normal . . . gave an internal error === Omitting the return value === In [[awk]], if no [[return value]] is specified, . . .
2K - last updated 2011-05-03 17:29 UTC by markhobley
ReverseMapping
{{{ awk # reverse mapping of keys -> values in given array function reverse_mapping(array, tmp_key, . . . if this swap would cause a colision, store those values if (array[key] in array) { tmp_key = array[ . . . # if we had a collision, reverse those values, too if (tmp_key) { array[tmp_element] = tmp_key . . .
2K - last updated 2014-04-23 00:33 UTC by emg
RS
= Record Separator = The [[special variable]] RS is a record separator that is used to determine how . . . line switch enables the default record separator value to be changed at invocation time. Here we change . . . the middle of processing an input file == If the value of the record separator is changed in the middle . . . of processing an input file, then the new value of the record separator will be used as a delimiter . . .
3K - last updated 2013-02-19 23:11 UTC by markhobley
SizeOfSplit
How many elements were created by split()? When I do a split on a field, e.g., {{{ awk split($1,x,"string") . . . x)' test)? split() is a function; use its return value: {{{ awk n = split($1, x, "string") }}} . . .
1K - last updated 2008-11-18 12:35 UTC by pgas
special variable
Some [[variable]] names have a special meaning to the awk interpreter. == List of special variables == . . . that specifies the output format of numerical values | [[OFS]] | A control variable that specifies . . .
2K - last updated 2011-06-25 05:46 UTC by pgas
Transpose
To transpose a N rows x M columns file into a M rows x N column file, one approach is to read the whole . . . the output is built line-by-line and after N values are concatenated, the line is printed and set . . .
1K - last updated 2011-03-20 06:53 UTC by ppp089210038204.dsl.hol.gr
truth
== Boolean Truth == A **boolean [[expression]]** has only two outcomes: **true** or **false**. In [[awk]], . . . [[expression]]s that evaluate to the numeric value 0 or to the empty string are false. The rest . . . "true"} else {print "false"}}' false }}} | **Value** | **True/False** | 0 | false | 1 | true | -1 . . . used. ==== Taking zero from the data source If a value of "0" or "000" or " 00", is taken from the data . . . source, then awk considers this to be a numeric value and it evaluates to false . The following example . . .
3K - last updated 2013-02-20 17:34 UTC by markhobley
variable
A '''variable''' is a symbolic name associated with a [[value]]. A variable acts as a container and the . . . [[value]] it contains may be changed from within a running . . . and can hold either [[numeric]] or [[string]] values. === Variables do not need predefinition prior . . . and to make sure they have proper initial values. === Variable names === As in most programming . . .
3K - last updated 2012-04-22 11:42 UTC by unregistered
WartAndWishList
Awk is a wonderful language! That said, there are a few annoying bits... == The Good * well-documented . . . no way of declaring an array without assigning a value to a key. This isn't a semantic problem, but . . .
7K - last updated 2009-04-13 18:39 UTC by goedel
XMLScraping
You cannot easily parse xml with awk. But there are several tricks to scrap an xml file: <toc> . . . }}} === Extracting the value of the attribute foo ==== if you want all the . . . extract the content of the tag: {{{ something FS value" something else FS value" something else }}} . . .
2K - last updated 2011-11-23 15:06 UTC by pgas
73 pages found.