Sure you can, but that's not what your code does. If you want to sort column 16, you will first have to select the 16th column
, before you can sort it. So you would do:
What you certainly can't do is reading the input one line at a time, writing something for each line, and then expect the entire thing to be sorted when you're done.