# /u/sy/beebe/tex/ndvi/xref4.awk, Mon Jul 17 16:15:52 1989 # Edit by Nelson H.F. Beebe # ======================================================================== # Wrap lines at last blank before column 67 (fold, alas, will not do this). # Wrapping is flagged by a backslash in the last column, and an initial # tab on the following line. # # Usage: # awk -f xref4.awk outfile # [17-Jul-89] # ======================================================================== BEGIN {MAXLEN = 67;} { line = $0; maxlen = MAXLEN; while (length(line) > maxlen) { for (k = maxlen; (k > 1) && (substr(line,k,1) != " "); --k) ; printf("%s \\\n\t",substr(line,1,k-1)); line = substr(line,k+1); maxlen = MAXLEN - 8; } if (length(line) > 0) print line; }