# GAWK script for the creation of HTX pages #### Keep only RECENT volumes for Journals #### Input arguments: # ft = File with Titles # mv = Maximal number of Volumes to keep # jnl = Journal Abbreviation (a.g. A+A) function compress(s){ # Remove all useless blanks gsub(/ +/," ",s); # Multiple blanks squeezed sub(/^ /,"",s); sub(/ $/,"",s); # Initial/Terminal blanks return(s) } # Definitions: Read All Titles (ft) BEGIN { while((getline < ft) > 0){ split($0, w, "="); sub(/^J\./, "", w[1]) ; titre[compress(w[1])] = compress(w[2]); } fe = "/dev/stderr" ; } #### Lines giving a link to Query start by vCat, or pCat or fCat /^\\.Cat{/ { if (nv > mv) next ; # Maximal number of volumes reached split($1, cat, "/"); v[cat[3]] += 1; # "v" array = count of papers / volume if (v[cat[3]] == 1) nv++ ; # A new volume was found ! if (nv <= mv) print; next } #### After the introduction text, a new paragraph. #### Add some links and the end of the introductory text. /^\\par\\hr/ { if (nv>0) next ; print "{\\em This list is {\\bf restricted to recent tables}, but" ; printf("\\A{J.%s.all.htx}{all electronic tables from %s} are accessible.\n", jnl, titre[jnl]) ; print "\\par \\A{\\glutag{Bazaar,u}\\#Query}{A search facility}" ; print "is available for finding the existing catalogues from " ; print "keywords, authors' names, etc, among all catalogues and tables"; print "existing at CDS.}" ; } #### The End #### Add also a link to Supplements / not Supplements #### /^\\CDStail/{ nv = 0 ; # To ensure last lines printed if (substr(jnl,length(jnl),1) == "S") jnl1 = substr(jnl, 1, length(jnl)-1) ; else jnl1 = jnl "S" ; print "\\begin{itemize}" print "\\item " printf("{\\em\\A{J.%s.all.htx}", jnl) ; printf("{List all existing tables from %s}}\n",titre[jnl]) ; if (jnl1 in titre) { printf("\\item{\\em\\A{J.%s.htx}", jnl1) ; printf("{Tables from %s}}\n",titre[jnl1]) ; } print "\\item " #printf("{\\em\\A{\\glutag{Bazaar,u}\#Query}{%s}}\n", #### Need an actual anchor -- otherwise is tranlsated in vizHelp printf("{\\em\\html{}{%s}\\html{}\n", "Find the existing catalogues from keywords, authors' names, etc}") ; print "\\end{itemize}" } #### The general lines { if(nv <= mv) print }