When I’m working on a CSV/TSV file, unless I deliberately select from the second row to end of file, and then in the Advanced Sort dialog box make sure “In Selection Only” is checked on (which should happen automatically, as it does in the Find/Replace dialog box), the Advanced Sort operation sorts headers as data. It should be possible to freeze the headers, as one can do in Excel, and Advanced Sort should have a “My data has headers” option, also like Excel’s, to ignore the top row when sorting.