Hi Norbert,
Thanks for your reply. The .txt file only has one filename in it in this case, thus the lack of the loop. The part I am having trouble with, is setting the parameter ndat equal to the count of nlines-1 (cheers for the correction). I realise this means changing ndat to another data...