Which language should be used to sort multifield records?
1995; Elsevier BV; Volume: 21; Issue: 10 Linguagem: Inglês
10.1016/0098-3004(95)00025-9
ISSN1873-7803
Autores Tópico(s)Diverse Scientific and Engineering Research
ResumoThree programs are presented which sort data according to any specified field within a multifield record. The paper presents the AWK language, a small programming language developed under UNIX, and also available under MS-DOS. It is effective to manipulate text and mixed types of variables. In a first approach, a program coded in structured BASIC, the user selects on which field data are going to be sorted. Sorting is done using a heapsort process. The second example is the literal translation of the former code into the AWK language. This coding is shorter and more efficient than the preceding one. A third version is presented, which takes advantage of the language and MS-DOS built-in functions. The result is a five-line program. Finally, the same process is done using the built-in sort function from UNIX, but ported to MS-DOS with expanded options. It emphasizes the small number of lines required to develop programs that manipulate files using AWK. Source code for these programs are listed in the Appendix.
Referência(s)