# addCf.sh Dec 13 2001 # Revised Jul 03 2003 # prim-ed Oct 27 2007 # adds Cf. at the start of all %Y lines that don't have it. # This sometimes puts a Cf. where one is not needed, for # example when someone says # %Y A012345 The corresponding primes are A012321 # this would be changed to # %Y A012345 Cf. The corresponding primes are A012321 # which is wrong and the Cf. has to be removed by hand. # But for 95% of the lines this does the right thing, # and saves a lot of work. # Note to myself: remember to maintain the link # ln addCf.sh /usr/njas/wwwfiles/sequences/addCf.sh.txt # If you download this from my web page, it is important to # use the SOURCE FILE. DON'T mouse it off the screen # because many of the characters will not be visible. # Call this file addCf.sh (not addCf.sh.txt) # set a version of awk #AWK=/usr/common/bin/gawk gawk ' /%Y/ && $0 ~ /Sequence in context/ { print; next } /%Y/ && $0 ~ /Adjacent sequences/ { print; next } /%Y/ && $0 !~ /Cf/ { sub( "A......", "& Cf." ); print; next } {print} ' $1 # end