Sort query output files in query order instead of alphabetically