Movatterモバイル変換


[0]ホーム

URL:


Jump to content
Rosetta Code
Search

Category:AWK

Help
From Rosetta Code
(Redirected fromAWK)
Language
AWK
Thisprogramming language may be used to instruct a computer to perform a task.
Execution method:Interpreted
See Also:


Listed below are all of the tasks on Rosetta Code which have been solved using AWK.

AWK is a small but powerful programming language that can process and convert text files. AWK is part of everyUnix-derived system.

Each AWK program consists of pattern-action statements. The program reads each input line, checks lines against patterns, and runs matching actions. For programs that never read input lines, the entire program can be oneBEGIN { ... } block.

  • List users who have /bin/ksh as a shell.
    $awk-F:'$7 == "/bin/ksh" { print $1 }'/etc/passwd

AWK has only three types of variables: they are strings, floating-point numbers, and associative arrays (where every array index is a string). Conversion between strings and numbers is automatic. AWK also has regular expressions, which appear in many AWK programs. There are a few built-in functions, like cos() and sprintf().

  • Find average line length.
    $awk'{ cnt += length($0) } END { print cnt / NR }'/etc/rc

The name "AWK" comes from the initials of Alfred Aho, Peter Weinberger and Brian Kernighan: they invented AWK during the 1970s. A few decades later, Kernighan continues to maintain thereference implementation of AWK.

Links

Online-Execution

  • ideone.com - gawk, mawk (both are kept up to date)

Todo

Tasks_not_implemented_in_AWK

Subcategories

This category has the following 4 subcategories, out of 4 total.

Pages in category "AWK"

The following 200 pages are in this category, out of 740 total.

(previous page) (next page)

A

C

(previous page) (next page)
Retrieved from "https://rosettacode.org/wiki/Category:AWK?oldid=390492"
Categories:
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

[8]ページ先頭

©2009-2026 Movatter.jp