Sorting on a specific part of a field

Sorting on a specific part of a field

You can also sort on a specific part of a field if necessary.

To define which part of a field to sort on you give the position in the field at which to start the sort followed by the position in the field at which to end the sort.

The position at which to start the sort is given as the number of fields to skip followed by the number of characters to skip. For example:

   +2.3

tells sort to skip the first two fields and the first three characters of field 3.

The position at which to stop the sort is given as the number of the field followed by number of the character in that field at which the sort is to stop. For example:

   -3.6

tells sort to stop the sort at the 6th character in field three.

To sort on the fourth and fifth characters of field three:

   +2.3  -3.6

[Home] [Search] [Index] This site maintained by unixhelp@math.rutgers.edu
This page was last updated on September 05, 2006 at 10:30 am and is maintained by webmaster@math.rutgers.edu.
For questions regarding courses and/or special permission, please contact mclausen@math.rutgers.edu.
For questions or comments about this site, please contact help@math.rutgers.edu.
© 2012 Rutgers, The State University of New Jersey. All rights reserved.