#/bin/sh mv $1 $1.orig touch $1 awk '{ s = $0 do { match(s,"[A-Z][a-zA-Z0-9_]*\\.") if (RLENGTH>0) printf("open %s\n",substr(s,RSTART,RLENGTH-1)) s = substr(s,RSTART+RLENGTH) } while (RLENGTH>0)}' $1.orig | sort | uniq >> $1 echo >> $1 awk '{ gsub("[A-Z][a-zA-Z0-9_]*\\.","") print $0}' $1.orig >> $1