Wow, what a mess! Here's a better rendition, plus a minor change in the shell script (add a necessary backslash after the pipe in the sort statement): Here's an awk scriptlet to detect duplicates in an AAtab file. Note that for this to work properly, the list of COMP:BLOCK entries *must* be in alphabetically-sorted order. awk '{while ($0) # as long as there are data {c=$1; b=$2; ln=$0 # keep COMP, BLOCK & current line getline # go to the next line if (c==$1 && b==$2) # if COMP and BLOCK are the same {print ln"\n"$0} # print previous and current lines }}' <WPlbug>AAtab You can put this scriptlet in a shell script called, say, chkdup: #!/bin/sh # this file is called 'chkdup' # sort the input file fisrt to make sure it's in alpha order sort $1 |\ awk '{while ($0) # as long as there are data {c=$1; b=$2; ln=$0 # save COMP, BLOCK & current line getline # go to the next line if (c==$1 && b==$2) # if COMP and BLOCK are the same {print ln"\n"$0} # print previous and current lines }}' and the script file can be executed with the desired AAtab file as an input on the command line: ./chkdup /usr/fox/alarms/<WPlbug>AAtab Duc -----Original Message----- From: foxboro-bounce@xxxxxxxxxxxxx [mailto:foxboro-bounce@xxxxxxxxxxxxx] On Behalf Of Grace, Kathy Sent: Tuesday, January 15, 2008 9:54 AM To: foxboro@xxxxxxxxxxxxx Subject: Re: [foxboro] foxboro Digest V8 #11 Detecting Dups in the AAtab File -------------------------------- The easiest way of detecting duplicate Compound:Block entries in the file is the following: Open the AApan file with Wordpad. = - Select all lines of the file except for the header comment lines. - Copy those lines to the paste buffer. Open Excel. = - With your cursor in the cell A1, paste the contents of the paste buffer into the spreadsheet. - Expand columns as needed. - Sort on the block column (B) - Sort on the compound column (A) Your spreadsheet should now be sorted first by compound then by block. Look at adjacent lines for the same Compound:Block. Columns C and D will tell you whether multiple assignments are made to different or the same annunciator keys. I am not sure if any problems would occur if two duplicate lines appear the the file (i.e. same Compound:Block assigned to the same key more than once). However if you have the same Compound:Block assigned to more than one key only the first key will be annunciated when an alarm occurs. Once Alarm Alert detects a match it annunciates the alarm and stops searching. So the remaining keys configured will not be annunicated. Kathy _______________________________________________________________________ This mailing list is neither sponsored nor endorsed by Invensys Process Systems (formerly The Foxboro Company). Use the info you obtain here at your own risks. Read http://www.thecassandraproject.org/disclaimer.html foxboro mailing list: //www.freelists.org/list/foxboro to subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=join to unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave