I've gotten this far but knowing a little C I know that I'm not loading the array correctly as there should be some sort of loop. But I can't find any good tutorials to show me how to do what I want to do.
What are you hoping to achieve? The order in which elements in a for( i in array ) construct are returned is "arbitrary" (thus, most likely messing up your nicely sorted input).
Ah scott, thanks for that, I removed the $2, I think I added it in when I was testing out some examples I found on the net.
I don't quite understand the second bit your wrote thou. I am now getting the data.txt printed out but not in sort order. So I know what your saying but don't quite know what your getting at. I should also have 20 numbers some of them duplicates but I'm only getting about 14. I think the duplicates are being rolled into one.
Thanks for that scott, exactly what I needed to get my head around. Once I (you) had it in the array an understood how it worked in awk the rest was easy, so thank you for that!