Just have the print command in the same loop, although with the locate command you have the first one would be written over.