# /u/sy/beebe/jclt.awk, Mon Jan 28 10:41:05 1991 # Edit by Nelson H.F. Beebe ### ==================================================================== ### @Awk-file{ ### author = "Nelson H. F. Beebe", ### version = "1.02", ### date = "06 January 1992", ### time = "08:08:57 MST", ### filename = "jclt.awk", ### address = "Center for Scientific Computing ### Department of Mathematics ### South Physics Building ### University of Utah ### Salt Lake City, UT 84112 ### USA ### Tel: (801) 581-5254 ### FAX: (801) 581-4148", ### checksum = "09251 86 396 3313", ### email = "beebe@magna.math.utah.edu (Internet)", ### codetable = "ISO/ASCII", ### keywords = "", ### supported = "yes", ### docstring = "Editor Rex Jaeschke periodically supplies a ### file in the format ### ### 3/1 1. {1} Translating Multibyte Characters -- P.J. Plauger ### 3/1 2. {12} A Standard C Compiler for the Transputer -- Rob E.H. Kurver ### ... ### ### which this file converts into a .bib file ### addition for jclt.bib ### ### Usage: ### nawk -f jclt.awk tempfile ### ### The checksum field above contains a CRC-16 ### checksum as the first value, followed by the ### equivalent of the standard UNIX wc (word ### count) utility output of lines, words, and ### characters. This is produced by Robert ### Solovay's checksum utility." ### } ### ==================================================================== /^[0-9]\/[0-9]/ { split($1,subfield,"/"); volume[++n] = subfield[1]; number[n] = subfield[2]; page = $3; gsub(/[{}]/,"",page); start_page[n] = page; rest = substr($0,15); k = index(rest," -- "); author[n] = (k > 0) ? substr(rest,k+4) : ""; title[n] = (k > 0) ? substr(rest,1,k-1) : rest; } END { for (k = 1; k <= n; ++k) { if (author[k] == "") author[k] = "Anonymous"; gsub(/\. */,". ",author[k]); nf = split(author[k],subfields," "); lastname = subfields[nf]; print "@Article{" lastname ":JCLT-" volume[k] "-" number[k] "-" \ start_page[k] ","; print " author = \"" author[k] "\","; print " title = \"" title[k] "\","; print " journal = j-JCLT,"; print " year = \"1992\","; print " volume = \"" volume[k] "\","; print " number = \"" number[k] "\","; print " pages = \"" start_page[k] "--" (start_page[k+1]-1) "\","; if (number[k] == "1") print " month = jun,"; else if (number[k] == "2") print " month = sep,"; else if (number[k] == "3") print " month = dec,"; else if (number[k] == "4") print " month = mar,"; else print " month = ???WHAT MONTH???,"; print "}\n"; } }