That's it. I needed to grab all the info produced by NSLOOKUP, so I don't need to sort it, just dump it into a text file.
I have 13,000 accounts that I have to run this on, obviously this is much faster than manually doing all 13000!!
Thanks for you help.