AllAboutGetline
//Editor's notes: The article was originally posted on the comp.lang.awk newsgroup, and can still be . . . "b" above writes the letters of the alphabet in reverse order, one per line, down the two-way pipe . . .
16K - last updated 2009-02-15 22:14 UTC by waldner
AwkTips
<toc> ---- == Be idiomatic! In this paragraph, we give some hints on how to write more idiomatic . . . succeeds, just as we wanted. As said above, the reverse is also true. Another typical problematic program . . .
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 . . . backreferences natively. Example: {{{ awk # reverse letter and following digit and insert "+" if . . .
3K - last updated 2010-12-30 06:53 UTC by ppp089210039107.dsl.hol.gr
CAWKLib
=CAWKLib CAWKlib is a library of functions for for awk intended to be used with preprocessors/wrappers . . . -- repeat a string up to a certain length *str_reverse() -- revers a string *str_squeeze() -- reduce . . .
5K - last updated 2015-01-29 10:14 UTC by 108-243-116-77.lightspeed.cicril.sbcglobal.net
GeneralizedTextReplacement
Some times people need to recode in awk something they were previously doing with sed or another tool. . . . above code to emulate this sed command: {{{ # reverse letter and digit and insert "+" if letter is . . .
6K - last updated 2009-03-26 20:38 UTC by waldner
HomePage
This wiki is maintained by regulars from the **#awk** channel on **[[https://libera.chat/|irc.libera.chat]]** . . . read list of files in a directory * [[ReverseMapping]] reverse the mapping of keys -> . . .
5K - last updated 2023-06-26 04:15 UTC by HappMacDonald
reverse
The [[awk]] extraction and reporting language does not provide a [[builtin]] function for reversing strings. . . . example demonstrates the definition of a reverse function and its invocation: {{{ awk function . . . reverse(s) { revs = "" for (l = length(s); l > 0 . . . l, 1) revs = revs c } return revs } # Call the reverse function to reverse our string BEGIN { print . . . reverse("anut fo raj a rof tun A") } }}} . . .
1K - last updated 2011-06-25 05:11 UTC by pgas
ReverseMapping
{{{ awk # reverse mapping of keys -> values in given array function reverse_mapping(array, tmp_key, . . . done[key] for (key in array) { # if we already reversed this pair to avoid a collision, continue if . . . = array[ key] tmp_element = array[tmp_key] } # reverse the mapping of our current key -> element . . . delete array[key] # if we had a collision, reverse those values, too if (tmp_key) { array[tmp_element] . . . "c" for (k in a) printf("a[%s] = %s\n", k, a[k]) reverse_mapping(a) printf("\n") for (k in a) printf("a[%s] . . .
2K - last updated 2014-04-23 00:33 UTC by emg
SedFAQ
<toc> ---- == I have a line like "abdcgfjeuPATTERNfjfhghj", I want to get the PATTERN part, why . . . deleted after the replacements. ---- == How do I reverse the characters in a line? You may have seen . . . oneliners]]: {{{ sed # reverse each character on the line (emulates "rev") . . . to separate the part of word that has been reversed so far from the part that hasn't. Finally, . . .
34K - last updated 2010-02-14 17:56 UTC by waldner
string manipulation
* [[case conversion]] * [[length|Determine the length of a string]] * [[index|Determine the position . . . first and last characters from a string]] * [[reverse|Reverse a string]] * [[substr|Splicing a string . . .
1K - last updated 2011-07-04 22:12 UTC by markhobley
10 pages found.