Use INREC CHANGE to sort colors of the rainbow by color instead of alphabetical

Input File 1 - Colors.txt
Blue  
Green 
Indigo
Orange
Red   
Violet
Yellow
Sort Control Cards - SortByRoyGBiv.txt
 RECORD TYPE=T,LENGTH=30
 INREC FIELDS=(1,1,CHANGE=(1,
  'R','1',
  'O','2',
  'Y','3',
  'G','4',
  'B','5',
  'I','6',
  'V','7'),
  1)
 SORT FIELDS=(1,1,CH,A)
 OUTREC FIELDS=(2)
 END
Command Line
> ahlsort SortByRoyGBiv.txt Colors.txt SortedColors.txt
Output File - SortedColors.txt
Red
Orange
Yellow
Green 
Blue  
Indigo
Violet
Back to Examples