Different programs often use different orientations. For example airfoil data are sometimes separated in the upper and the lower side, both. Some programs require that both sides lie with on set starting with a the rear point of the upper side, running over the upper surface towards the nose and back to the rear over the lower surface. The GRToolbox can be used for this task:
gr_sort -f airfoil.dat | gr_sort -down -e1 -1 | gr_mergeor
gr_sort -f airfoil.dat | gr_invert -e1-1 | gr_merge