That is exactly what I'm trying to achieve. Although I already have all the lines of data stored in @contact_type. All I need to do is iterate over @contact_type and check for the defind pattern and print if any are repeated. Can the code you have provided be changed to do that ? <br.cheers harry