This wiki is maintained by regulars from the **#awk** channel on **[[https://libera.chat/|irc.libera.chat]]** (and previously [[http://www.freenode.net|irc.freenode.net]]). What is awk? see [[What_is_awk]] Feel free to edit the wiki, just press edit button, the formatting rules are summarized at the bottom of the edit box. If you are afraid to break something, feel free to play in the SandBox. If you feel you need more info see [[How to edit]]. You can download a full backup of the wiki there: [[http://awk.freeshell.org/download/]] <toc> ---- == #awk // //**#awk** is small with a low traffic, and is not different from the other channels of this size on irc ie: * Do not wait to see if someone is awake to ask your question, we will answer if we see one when we see it. * Be patient, we do answer to most of the questions * The best way to ask a question on #awk is often to use a PasteBin containing a sample of your input data and a sample of the output you expect. * if #awk doesn't answer maybe consider asking in comp.lang.awk Here is an, incomplete, not always up to date, list of some of the ChannelRegulars == Documentation * the traditional [[Frequently Asked Questions]] and their answers * [[XMLScraping]] ok, you don't want to use a parser * All about getline, by Ed Morton (comp.lang.awk): [[AllAboutGetline]] * some [[AwkTips]] * AwkFeatureComparison -- handy matrix to know what you can or cannot do with your awk * BeforeAfterMatch -- if what you want depends on the content of other lines * GeneralizedTextReplacement -- what to do if you desperately need backreferences * [[http://awk.freeshell.org/LinksPage#toc2|elsewhere on the web]] * CookBook -- just started, please contribute * AwkGuide -- work in progress * MicrosoftWindowsInstallation -- Installation of an awk interpreter in Microsoft Windows == Useful code snippets * FindAllIndices of a particular character in a string * FindAllMatches of a particular pattern in a string * RepeatAString n times * FormatFileSizes in human readable format * LevenshteinEditDistance to compute a score for the difference of two text strings * PrimeNumberSieve implemented in two slightly different ways, with comparative performance numbers under a variety of implementations * ComparingTwoFiles an example * DeleteTrailingNewlines * [[Adler32Checksum]] in pure awk * [[Columnate]] a file * [[ContextGrep]] -- print context lines around a match * [[Shellquote]] strings for use in shell commands * [[Transpose]] a file * [[SimpleCalc]] simple 4 operations calculator....no particular use * [[ReadDirectory]] read list of files in a directory * [[ReverseMapping]] reverse the mapping of keys -> values in an array === gawk specific code snippets The following functions utilize [[gawkism|gawk specific features]], and so require the use of the [[gawk]] interpreter in order to operate: * [[ConvertHexToFloatingPoint]] - turns a hex string of 4 bytes of IEE754 Floating point back into a floating point number * [[GeoLocation]] Find where your IP address is located ---- == Requests for Implementation It may be that some people in the channel want code written to solve specific problems. These solutions may benefit from review, cooperative work and a location perhaps a bit more permanent than a PasteBin. * [http://rosettacode.org/wiki/Reports:Tasks_not_implemented_in_AWK Tasks that require AWK solutions on Rosetta Code] * rawtaz's TCPDumpParser, which was used to filter IPs during a {{{DoS}}} attack * Thanatermesis's LshalOutputParser, which was used to find all the storage devices listed by the lshal utility * ajai / mib's FileAndBitJoinClone, which was used to print out the lines from an input file called bit.txt that were referred to in a file called file.txt (unfortunately this is as specific a description of these two files as was ever provided; it is all very abstract) * [[Recursively Include C headers]] * Eric S Raymond's https://gitlab.com/esr/tapview consumer for the Test Anything Protocol https://testanything.org/ is written in Bash for portability's sake, but should instead be ported to Awk instead for performance's sake. ---- == Variants of awk * [[gawk]] * [[mawk]]/[[libmawk]] * [[bwk]] * [[nawk]] * [[oawk]] * [[bbawk]] (busybox awk) * [[jawk]] * [[awka]] * [[qse]] See also: [[AwkFeatureComparison]] == Links * the traditional grab bag LinksPage == Thank you!! The StyleSheet of this wiki has been borrowed (with permission) from the [[http://heirloom.sourceforge.net | heirloom project website]]. Be sure to check this excellent project, it provides, among many many other utilities, 2 implementations of awk: [[http://heirloom.sourceforge.net/man/oawk.1.html | oawk]] and [[http://heirloom.sourceforge.net/man/nawk.1.html nawk]]
Summary:
This change is a minor edit.
Username: