Actually, after checking, the Uniq() UDF posted on my site no longer needs the array to be sorted. That simplifies the code above and eliminates any potential issue with changing the data sequence.

Load the file into an array with FileIO

Remove dups with the Uniq() UDF - you can use the same array name for both parameters - $aFileData = Uniq($aFileData) - this gives you the unique result.

Save the array to a file (can be the same file) - FileIO('filename', 'W', $aFileData)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D