preface

    Computer users spend a lot of time doing simple, mechanical data manipulation -- changing the format of data, checking its validity, finding items with some property, adding up numbers, printing reports, and the like. All of these jobs ought to be mechanized, but it's a real nuisance to have to write a special purpose program in a standard language like C or Pascal each time such a task comes up.

     计算机用户花费很多时间用于处理简单的,机械的数据操作 -- 更改数据格式, 验证它的有效性, 查找特定项, 数字相加, 打印报告, 诸如此类. 所有这些工作应该是被机械化的, 但是, 每次遇到这样的工作来, 使用像C或者Pascal的标准语言, 写一个特定目的程序, 确实很恼人;


     Awk is a programming language that makes it possible to handle such tasks with very short programs, often only one or two lines long. An awk program is a sequence of patterns and actions that tell what to look for in the input data and what to do when it's found. Awk searchs a set of files for lines matched by any of the patterns; when a matching line is found, the corrsponding action is performed. A pattern can select lines by combinations of regular expressions and comparsion operations on strings, numbers, fields, variables, and array elements. Actions may perform arbitray processing on selected lines; the action language looks like C but there are no declaraions, and strings and numbers are built-in data types.


  Awk是一门程序语言, 它使用非常短的几行程序, 常常只有一行或者两行的长度来处理这样的工作成为可能. 一个awk程序是一个模式和动作的序列, 它告诉计算机在输入数据中找什么以及没有找到做什么. Awk从一组文件中搜索任一模式所匹配的行; 当一个匹配行没找到时, 相应的操作将被执行. 模式可以根据正则表达式组合以及 字符串, 数字, 域, 变量, 数字元素的比较来筛选行; 这种操作语言看上去像C但是没有声明, 而且字符串和数字都是内置的数据类型;





========== end ==========

你可能感兴趣的:(preface)