AA-awk-history
http://awk.freeshell.org/AA-awk-history\\ a concise history of awk and some of its forks\\ {{{ common . . . https://github.com/danfuzz/one-true-awk\\ [4] first? commercial awk for . . .
2K - last updated 2013-10-26 02:28 UTC by g0ph3r
AA-awk-one-page
http://awk.freeshell.org/AA-awk-one-page\\ 2013-09-19 20:23:02 http://awk.freeshell.org/g0ph3r\\ attempt . . . portal: http://awk.info/?var/toc\\ irc chat channel: irc://irc.freenode.net/#awk . . . http://awk.freeshell.org/AwkVsPerl\\ http://awk.info/?Sed\\ . . .
2K - last updated 2013-09-20 06:55 UTC by g0ph3r
Adler32Checksum
As documented in the [[http://en.wikipedia.org/wiki/Adler-32 | Adler-32 Wikipedia article]]. {{{ awk . . . here and shared across the global namespace. # Unfortunately awk features no lexical scoping and no . . .
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 . . . of getline (mis)use, was based primarily on information from the book "Effective Awk Programming", . . . Mc{{{}}}Cormack, Janis Papanagnou, Anton Treuenfels, Thomas Weidenfeller, John La{{{}}}Badie and . . . |=Variant|=Variables Set| |getline|$0, ${1...NF}, NF, FNR, NR, FILENAME| |getline var|var, FNR, . . . NR, FILENAME| |getline < file|$0, ${1...NF}, NF| |getline var < file|var| |command ~| getline|$0, . . .
16K - last updated 2009-02-15 22:14 UTC by waldner
awk-glossary
concise glossary of the essential awk - Last edited 2014-08-04 02:26 UTC\\ Contents: . . . http://awk.info/?Sitemap\\ IRC chat: . . . https://github.com/danfuzz/one-true-awk\\ history: . . .
5K - last updated 2014-08-04 03:23 UTC by y0tta
awk 2012 ISO
**[[awk_2012_ISO]]** revised: . . . interview: [[http://awk.info/?news/robbinsTalks| awk.info robbinsTalks]]\\ \\ . . .
4K - last updated 2012-09-16 03:39 UTC by g0ph3r
awk nawk oawk
in 1977 there was awk.\\ this page attempts to explain the history of awk.\\ the 1978 7th Edition awk(1) . . . they enhanced it and wrote a book.\\ to avoid confusion, the original was called oawk\\ and the new . . . version nawk.\\ it has been a major source of confusion ever since.\\ the awk book from 1988\\ http://www.cs.bell-labs.com/cm/cs/awkbook/index.html\\ . . . undocumented command line switch -d dumps debug info.\\ valid filenames /dev/stdin /dev/stdout /dev/stderr\\ . . . of ^ for exponention. }}} array SYMTAB holds info, eg: {{{awk BEGIN { _print_SYMTAB(); exit(0); } . . .
2K - last updated 2012-03-18 23:21 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] . . . as currently implemented because it cannot loop infinitely: every version I know of will overflow the . . . the stack via putstring(). {for (i = 1; i <= NF; i++) _dc_dispatch(S, $i)} }}} ...and here is a . . .
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 . . . split characters|{{{echo abc|awk -F '' '{print NF}' # 3}}}| |=FS can match the empty string|{{{echo . . . aaba|awk -F 'b*' '{print NF}' # >2}}}| |=split() splits chars with empty . . .
4K - last updated 2015-04-27 13:23 UTC by pgas
AwkGuide
** Work in Progress ** {{{ import from Mark Hobley's wiki }}} <toc> ---- == Overview * [[Overview]] . . . conditional constructs * [[include]] files * [[infinite loop]]s * [[input]] * [[instruction]]s * integer . . . * [[multiline]] records * [[multiplication]] * [[NF]] * [[nudge operator]]s * [[number]]s * [[operator]]s . . .
4K - last updated 2011-08-14 15:57 UTC by markhobley
AwkOnWindows
[[AwkOnWindows|This page]] lists available versions of awk for ms windows.\\ Example: //awk /foo/{print(NR,$0)} . . . \\ and mawk 1.3.3 Ported to Win32 by Olaf Schoenfeldt. http://www.klabaster.com/progs/awk95.zip 88kB\\ . . .
2K - last updated 2010-10-24 09:39 UTC by g0pher
AwkTips
<toc> ---- == Be idiomatic! In this paragraph, we give some hints on how to write more idiomatic . . . lines where the second field is "foo" awk 'NF >= 6' # prints lines with 6 or more fields awk . . . /foo/ to line matching /bar/, inclusive awk 'NF' # prints only nonempty lines (or: removes empty . . . lines, where NF==0) awk 'NF--' # removes last field and prints the . . . that agin uses the two-files idiom: {{{ # use information from a map file to modify a data file awk . . .
31K - last updated 2009-03-24 16:54 UTC by waldner
Backreferences
The usual (and correct) answer for backreferences in awk (for example, the answer you can get on #awk . . . of all matches. See the gawk manual for more information (including why backslashes must be escaped . . . out things]] for more information and examples. * Third answer: see [[GeneralizedTextReplacement]] . . .
3K - last updated 2010-12-30 06:53 UTC by ppp089210039107.dsl.hol.gr
BackslashInRegexp
Because {{{"\\$"}}} is a string and {{{/\\$/}}} is not; in strings, some of the escape characters get . . . => `(N|S)(E|W)' only }}} There is also confusion regarding different forms of special characters; . . .
2K - last updated 2008-11-26 12:27 UTC by pgas
bwk
===bwk awk=== The original implementation of awk. Named after the initials of its primary author, Brian . . . in the git repository at [[https://github.com/danfuzz/one-true-awk]]. . . .
1K - last updated 2013-04-12 19:52 UTC by 67.80.208.web-pass.com
CAAN-or-caan
**caan: the comprehensive awk archive network**\\ -or-\\ . . . ---- **Archives:**\\ http://awk.info/?Sitemap sitemap - topics . . .
4K - last updated 2014-05-29 02:01 UTC by g0ph3r
CaseInsensitive
{{{}}}**Use tolower()** * portable * must be explicitly used for each comparison Instead of: {{{ awk . . . code, add a line like: {{{ awk { for (i=0;i<=NF;i++) $i=tolower($i) } { $0=tolower($0); } # modern . . . awks will rebuild $1..$NF also }}} {{{}}} **Use IGNORECASE=1;** * gawk only . . .
1K - last updated 2008-11-26 12:39 UTC by pgas
Columnate
This script columnates the input file, so that columns line up like in the GNU column(1) command. Its . . . { line[NR] = $0 # saves the line for (f=1; f<=NF; f++) { len = length($f) if (len>max[f]) max[f] . . . widths } } END { for(nr=1; nr<=NR; nr++) { nf = split(line[nr], fields) for (f=1; f<nf; f++) . . .
1K - last updated 2009-02-28 21:32 UTC by h-67-101-152-180.nycmny83.dynamic.covad.net
CookBook
<toc> ---- Just started, the aim of this page is to collect small pieces of code that illustrate . . . of a Record(lines) <include "LoopOnFields"> [[http://awk.freeshell.org/?action=edit;id=LoopOnFields| . . .
1K - last updated 2009-04-14 09:03 UTC by 216.162.199.202
DeleteTrailingNewlines
Simple oneliner that deletes the trailing newlines of a file: {{{ sh awk '!NF{b=b "\n";next} {printf . . . "%s%s",b,$0;b="\n"}' file }}} Explanations: * !NF : "If the line is blank (ie NF==0), then accumulate . . . one trailing newline, add one ;): {{{ sh awk '!NF{b=b "\n";next} {printf "%s%s",b,$0;b="\n"} END {print . . .
1K - last updated 2008-12-31 12:07 UTC by pgas
division
== Quotient Division == The [[slash]] symbol can be used as the division [[operator]] to produce the . . . by zero is encountered. Instead mawk returns an inf string without producing a warning or error: # This . . . awk implementations BEGIN { print 3 / 0 # inf } . . .
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]]: . . . two to a value of 23 }}} == See also == * [[NF|Number of fields]] . . .
3K - last updated 2011-06-25 05:28 UTC by pgas
END
The [[awk]] programming language allows us to use **end blocks** to provide [[finishoff]] and [[cleanup]] . . . contain actions. == There is no current record information available within an end block There is no . . . current record information available within an end block, because end . . .
2K - last updated 2011-04-30 22:52 UTC by markhobley
fcr
== Francisco Castro Buenas, me presento, soy Francisco Castro, conocido en el irc como fcr (la sigla . . . En mi sitio web: [[http://fideo.no-ip.info]], podrán encontrar información personal, y sobre . . .
1K - last updated 2009-02-13 07:45 UTC by pgas
FileAndBitJoinClone
== Problem Description This was difficult to hash out. Eventually the task was described as, "for each . . . BL{print BL[$3]}' bit.txt file.txt }}} For more information on awk idioms (including the previous one), . . . zVfxV6/1/lf9z/mvv8RaL19Eimnrpr19KSLD7MunfPkPvP72/7/85v8+ny9/ +Mtf//zXv/zz3/t3+v/oq/zkL/z1VY6f9fjZjp/r8XM7fu7Hz+P4eR4/r/NY . . . 1uN9UlLJle2lY7JIGb4lVV1JXVdS2WGn6b39tSX1XknFV7Y3HXFlqFduLuDU wLmCcwfnEs4tnGsYJ7tjY/c4chejjAVVZ+a9X54b8m0hmUItV5xoa74h+Urd . . . 1NfSk52e7PSnnZ7soKtxWZv4/zNY9IeaLKWuFpT1cSCU9bkhGRtPY6mxBRfr . . .
7K - last updated 2009-03-08 16:26 UTC by waldner
FIXES
[[FIXES]] revised: . . . awk -f - reads the program from stdin.\\ enforce variable name syntax for commandline variables:\\ . . . features:\\ command line switch -d dumps debug info.\\ valid filenames /dev/stdin /dev/stdout /dev/stderr\\ . . . of ^ for exponention.\\ array SYMTAB holds info.\\ from commandline: -F "" is . . .
6K - last updated 2014-01-15 23:17 UTC by g0ph3r
FNR
The *FNR* informative [[special variable]] is used to track the number of [[record]]s that have so far . . .
1K - last updated 2011-05-08 11:04 UTC by markhobley
FS
= Field Separator = The [[special variable]] FS is a field separator that is used to determine how [[awk]] . . . | awk 'BEGIN { FS = " " } { for (l=1;l<=NF;l++) print l ":" $l }' # This gives five fields, . . . | awk 'BEGIN { FS = "#" } { for (l=1;l<=NF;l++) print l ":" $l }' }}} == Matching a single . . . | awk 'BEGIN { FS = "[ ]" } { for (l=1;l<=NF;l++) print l ":" $l }' }}} == Leading and trailing . . . not followed by a third l: {{{ #!/bin/sh echo Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch| . . .
5K - last updated 2013-02-19 21:45 UTC by markhobley
gawkism
Gawkisms are non portable syntax components that do not work with some awk implementations. The use of . . . function) * [[pipeand]] operator * [[PROCINFO]] * [[RS]] can be a [[regular expression]] * [[rshift]] . . .
2K - last updated 2011-05-19 22:29 UTC by markhobley
Genius
http://awk.freeshell.org/Genius\\ Genius People - was looking for people that contributed . . . Archimedes\\ http://en.wikipedia.org/wiki/Confucius 551û479 . . . \\ . . .
6K - last updated 2014-07-07 06:17 UTC by y0tta
getline
The *getline* command can obtain input from any number of files and does not require a command line parameter . . . | *Variables Set* | getline | $0, ${1...NF}, NF, FNR, NR, FILENAME | getline foobar | foobar, . . . FILENAME | getline < foobar.txt | $0, ${1...NF}, NF | getline foobar < foobar.txt | foobar | . . . {{{foo | getline}}} | $0, ${1...NF}, NF | {{{foo | getline}}} foobar | foobar === Failure . . .
1K - last updated 2011-05-02 20:14 UTC by markhobley
HomePage
This wiki is maintained by regulars from the **#awk** channel on **[[https://libera.chat/|irc.libera.chat]]** . . . play in the SandBox. If you feel you need more info see [[How to edit]]. You can download a full backup . . . were referred to in a file called file.txt (unfortunately this is as specific a description of these . . .
5K - last updated 2023-06-26 04:15 UTC by HappMacDonald
How do I report a bug in gawk
This is described in great detail in the gawk documentation. In brief: # Make sure what you've discovered . . . post to comp.lang.awk; this allows others to confirm or deny the behavior, and its incorrectness (or . . .
1K - last updated 2008-11-18 12:07 UTC by pgas
How do I report a bug in gawkJapanese
This is described in great detail in the gawk documentation. In brief: # Make sure what you've discovered . . . post to comp.lang.awk; this allows others to confirm or deny the behavior, and its incorrectness (or . . .
1K - last updated 2008-11-24 08:07 UTC by pgas
Inicio
Este wiki es mantenido por los usuarios del cenal **#awk** en **[[http://www.freenode.net|irc.freenode.net]]**. . . . código y otras cosas de awk: [[http://awk.info/]]. * OSNews has posted a story titled [http://www.osnews.com/story/20055/The_Great_Language_with_a_Strange_Name|The . . . conocido como el 'awk viejo', o de forma más confusa, 'awk': la versión original del lenguaje, carece . . . were referred to in a file called file.txt (unfortunately this is as specific a description of these . . .
7K - last updated 2009-02-12 23:31 UTC by fcr
input
The [[awk]] utility can take its input from [[standard input]] or from [[file]]s. If no input files are . . . | *Variable* | *Description* | [[FNR]] | An informative variable that provides the record number . . . that specifies the input field separator | [[NF]] | An informative variable that provides the number . . . fields within the current record | [[NR]] | An informative variable that provides the total number . . .
2K - last updated 2011-05-19 22:40 UTC by markhobley
LastField
awk performs a number of actions automatically when it parses lines: it updates the variable NF, which . . . also refers to first field. Since the variable NF contains the number of fields on a line, and since . . . fields are indexed starting from 1, $(NF) (or just $NF) contains the last field in any given . . . $i # yes it prints the first field print $NF # prints the last field print $(NF-1) # prints the . . . Variables that convey information]; * [http://www.gnu.org/software/gawk/manual/html_node/Fields.html|Examining . . .
2K - last updated 2009-02-05 22:43 UTC by firebush.stsci.edu
length
== Usage == === length ([ STRING ]) === The **length** function returns the number of characters within . . . [[argument]]: {{{ awk BEGIN { print length("Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch") . . .
1K - last updated 2011-06-25 05:11 UTC by pgas
limitation
== Limitations of awk Some traditional versions of [[awk]] derived from [[Unix]] version 7, may not conform . . .
1K - last updated 2009-04-20 15:50 UTC by Mark Hobley
LinksPage
<toc> ---- == websites dedicated to awk == * [[http://awk.info/|awk.info]] news and articles about . . .
4K - last updated 2015-02-24 14:45 UTC by pgas
logical operator
In [[awk]], *logical operators* are used to perform [[boolean]] operations, and a return a value of [true] . . . Expressions Containing Multiple Operators == Confusion Between Logical and Bitwise Operators ---- . . .
3K - last updated 2009-01-02 11:13 UTC by pgas
LoopOnFields
Fields are numbered from 1 to NF, so you can easily use a for loop, and the derefence operator, for instance . . . each field matching foo: {{{ awk for (i=1;i<=NF;i++) { if ($i ~ /foo/) { print $i } } }}} . . .
1K - last updated 2009-03-17 21:09 UTC by waldner
LshalOutputParser
=== Problem Specification 10:50 <Thanatermesis> i want to obtain the model of the disk, for example, . . . 1, (length($2) - RLENGTH))) # remove type info } else { type = "udi" val = trim($2) } #printf . . . || (/^ / && (! inBlock)) { die("Block info line encountered out of sequence, parsing error!") . . .
3K - last updated 2008-06-27 16:22 UTC by gnomon
Mark Hobley
Welcome to this wiki! Thanks a lot for your contribution. As you seem to start a whole awk guide, maybe . . . since it comes from a wiki I cannot access i unfortunately cannot help for the import. I also removed . . .
1K - last updated 2009-01-27 08:04 UTC by pgas
mawk
The **mawk** package provides a very fast awk implementation by Mike Brennan[1] based on a byte code . . . be compatible with [[bwk]]. It also adds POSIX conformance and a few extensions. See also: [[libmawk]] . . .
1K - last updated 2023-11-23 19:50 UTC by AwkwardCoder
MayorNumeroPreciso-español
La mayoría de las implementaciones usan números de coma flotante de alta precisión conocidos como "double" . . . archivos de logs muy grandes: ¿Cuándo podémos confiar en los números de awk y cuándo deberíamos usar . . . lista de números. Por ejemplo, el mayor número confiable que este proceso encuentra al correr en mi . . .
1K - last updated 2009-01-03 07:01 UTC by fcr
NF
= Number of Fields = The [[special variable]] NF holds the number of [[field]]s in the [[current record]]. . . . === Last Record === The [[expression]] $NF is used to refer to the last [[field]] in the [[current . . . from each [[record]]: {{{ awk '{ print $1,$NF }' filename }}} . . .
1K - last updated 2011-05-28 15:14 UTC by markhobley
OpeningFiles
You can open files dynamically using `getline', `close', and `print EXPR > FILENAME', like: {{{ awk . . . 1 line, output file writeable function double(infilename,outfilename, aline) { while ( (getline aline . . . < infilename) >0 ) print(aline aline) > outfilename; . . . close(infilename); close(outilename); } }}} . . .
1K - last updated 2008-11-18 13:33 UTC by pgas
OpeningFilesJapanese
You can open files dynamically using `getline', `close', and `print EXPR > FILENAME', like: {{{ awk . . . 1 line, output file writeable function double(infilename,outfilename, aline) { while ( (getline aline . . . < infilename) >0 ) print(aline aline) > outfilename; . . . close(infilename); close(outilename); } }}} . . .
1K - last updated 2008-11-24 08:09 UTC by pgas
Overview
= Overview of awk = == The primarily purpose of awk is to processing textual data to produce formatted . . . as "A general purpose package with various configuration options, some of which may not be needed." . . .
4K - last updated 2011-05-23 23:09 UTC by markhobley
precedence
The [[awk]] programming language uses rules of *precedence* to determine the order in which [[operator]]s . . . expression is now 2 x -4 === Prefix, Postfix, Infix An [[operator]] is either a [[prefix]] operator, . . . a [[postfix]] operator or an [[infix]] operator depending upon is positioning within . . . its [[operand]] within an expression. ==== Infix Operators An [[infix]] operator is positioned . . .
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 . . . primes, line, sp, n, i, j) { line = $0; $0 = "" NF = N n = sqrt(N) primes[sp = 0] = 2 for (i = 3; i . . .
4K - last updated 2008-06-19 05:56 UTC by gnomon
PrintASingleQuote
This question gets asked often enough that it deserves its own answer. This common question doesn't actually . . . than two successive hex bytes to be specified. Unfortunately the precise behaviour when more than two . . .
5K - last updated 2015-07-05 09:45 UTC by pitman
printf-español
Muestra todas las palabras en cada línea: {{{ awk '{for(i=1;i<=NF;++i) printf "%s ", $i;print ""}' . . . primera, en cada línea: {{{ awk '{for(i=2;i<=NF;++i) printf "%s ", $i;print ""}' nombredearchivo . . . un vector: {{{ awk '{delete a;}{for(i=1;i<=NF;++i) a[i]=$i} { for (j in a) printf("%s ",a[j]); . . .
1K - last updated 2009-01-03 02:53 UTC by fcr
printf
== Usage == === printf [ FORMAT, LIST ] === The **printf** [[variadic]] function provides generic [[string . . . the words on each line: {{{ awk '{for(i=1;i<=NF;++i) printf "%s ", $i;print ""}' filename }}} Do . . . first word on each line: {{{ awk '{for(i=2;i<=NF;++i) printf "%s ", $i;print ""}' filename }}} Print . . . as an array: {{{ awk '{delete a;}{for(i=1;i<=NF;++i) a[i]=$i} { for (j in a) printf("%s ",a[j]); . . .
2K - last updated 2011-06-09 20:34 UTC by markhobley
PrintfDynamicWidth
With modern awks, you can just do it like you would in C (though the justification is less clear; C doesn't . . . didn't know about %* (this would be much more painful to do in C), like so: {{{ awk maxlen=0 for (i . . .
1K - last updated 2008-11-24 08:26 UTC by pgas
PrintfDynamicWidthJapanese
With modern awks, you can just do it like you would in C (though the justification is less clear; C doesn't . . . didn't know about %* (this would be much more painful to do in C), like so: {{{ awk maxlen=0 for (i . . .
1K - last updated 2008-11-24 08:36 UTC by pgas
PrintingNumbers
Use printf and a format string instead of print, some examples: {{{ awk BEGIN { printf "%f", 1000001.10 . . . #prints 1000001000000001 } }}} For more information about printf see [[http://www.gnu.org/software/gawk/manual/html_node/Printf.html#Printf|the . . .
2K - last updated 2009-03-04 12:34 UTC by pgas
RangeOfFields
Printing a range of fields - all fields but the first, for examples, or fields 3 through 8 - is a surprisingly . . . you want ({{{ {$1 = $2 = ""; for (i = 9; i <= NF; i++) $i = ""; print} }}}). This will however cause . . . possibility is to shift the fields and adjust NF eg to keep the fields 3 to 8: {{{ awk for (i=3;i<=8;i+=1)) . . . $(i-2)=$i # shift $1=$3 $2=$4 ... NF=8-3+1 # only keep the first six fields print }}} . . . as this: {{{ bash awk '{sep="";for (i=2;i<=NF;i++) {printf "%s%s",sep, $i;sep=" "}; printf "\n"}' . . .
10K - last updated 2015-09-08 09:52 UTC by pgas
read only variable
=== _User defined variables cannot be marked as readonly_ The [[awk]] extraction and reporting language . . . for defining readonly variables. === _Informative special variables_ Some informative [[special . . .
1K - last updated 2011-06-01 21:29 UTC by markhobley
RepeatAString
Sometimes it is useful to have something like Perl's 'x' operator, which repeats a string N times. This . . . and {{{gsub()}}}), but tests showed them to be inferior in terms of performance, memory usage, code . . .
1K - last updated 2009-03-01 19:15 UTC by h-67-101-152-180.nycmny83.dynamic.covad.net
SedFAQ
<toc> ---- == I have a line like "abdcgfjeuPATTERNfjfhghj", I want to get the PATTERN part, why . . . in place. See what GNU sed does (taken from the info page): {{{ -i This option specifies that files . . . other FAQ]] for more information). However, here is another method that does . . . of the line. Depending on our problem and the information we have, we may be forced to use one or . . .
34K - last updated 2010-02-14 17:56 UTC by waldner
SolarisNawk
I want to use the tolower() function with {{{SunOS}}} nawk, but all I get is {{{ nawk: calling undefined . . . in 1989, and /usr/xpg4/bin/awk is supposed to conform to the single > unix specification. No one . . .
1K - last updated 2008-11-24 08:24 UTC by pgas
SolarisNawkJapanese
I want to use the tolower() function with {{{SunOS}}} nawk, but all I get is {{{ nawk: calling undefined . . . in 1989, and /usr/xpg4/bin/awk is supposed to conform to the single > unix specification. No one . . .
1K - last updated 2008-11-24 08:36 UTC by pgas
special variable
Some [[variable]] names have a special meaning to the awk interpreter. == List of special variables == . . . | '''Variable''' | Description | [[ARGC]] | An informative variable that provides command line parameter . . . information | [[ARGV]] | An informative [[array]] that . . . provides command line parameter information | [[CONVFMT]] | A control variable that . . . format of numerical strings | [[ENVIRON]] | An informative array that contains the environment strings . . .
2K - last updated 2011-06-25 05:46 UTC by pgas
SplitIntoChars
In portable POSIX awk, the only way to do this is to use substr to pull out each character, one by one. . . . This is painful. However, gawk, mawk, and the newest version of . . .
1K - last updated 2008-11-24 08:20 UTC by pgas
SplitIntoCharsJapanese
In portable POSIX awk, the only way to do this is to use substr to pull out each character, one by one. . . . This is painful. However, gawk, mawk, and the newest version of . . .
1K - last updated 2008-11-24 08:35 UTC by pgas
StyleSheet
body { background-color:#FFF; color:#000; margin:1em 2em; } textarea { width:100%; } a:link { color:#00F; . . . } span.result { font-size:larger; } span.info { font-size:smaller; font-style:italic; } div.rss . . .
5K - last updated 2008-06-19 16: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 . . . real data): {{{ awk BEGIN{FS=","} {for(i=1;i<=NF;i++)a[NR,i]=$i} END{ for(i=1;i<=NF;i++){ for(j=1;j<=NR;j++){ . . . print line line=sep="" } } }}} NR is our N, and NF is our M here. In the END block, for M times, the . . .
1K - last updated 2011-03-20 06:53 UTC by ppp089210038204.dsl.hol.gr
What is awk
awk is an extraction and reporting language, named after its three original authors: * Alfred V. **A**ho . . . you'd like me to put a pointer to, please inform me -- I already have some pointers of this form . . . awk, now also known as 'old awk' or (confusingly) 'awk': the original version of the language, . . .
5K - last updated 2014-11-28 08:24 UTC by pgas
What is awkJapanese
awk is a programming language, named after its three original authors: * Alfred V. Aho * Brian W. Kernighan . . . you'd like me to put a pointer to, please inform me -- I already have some pointers of this form . . .
2K - last updated 2008-11-24 08:03 UTC by pgas
WhichIsBetter
This comes up so often that it deserves a page on its own. **NEVER**, **EVER** ask computer people whether . . . to run word processing software, but would be painfully slow and next to useless for people who use . . . while other people say that Kde's interface is confusing because of the high number of customizations . . . you mean by "good" in your specific situation. Unfortunately, many people, when asked, simply don't . . .
5K - last updated 2009-07-12 09:13 UTC by host-87-74-84-72.dslgb.com
XMLScraping
You cannot easily parse xml with awk. But there are several tricks to scrap an xml file: <toc> . . . is then easy: {{{ sh awk -F'</?tag>' 'NF>1{print $2}' }}} This can be generalized if you . . . {{{ sh awk -F'</?tag>' '{for(i=2;i<=NF;i++) print $i}' }}} ==== <tag> </tag> . . . the quote. {{{ sh awk -F'foo="' '{for (i=2;i<=NF;i+=2){ sub(/".*/,"");print $i}' }}} ==== all the . . . {{{ sh awk -v RS=\> -F '<tag.*foo="' 'NF>1{sub(/".*/,"",$2);print $2}' }}} . . .
2K - last updated 2011-11-23 15:06 UTC by pgas
73 pages found.