<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=SORT</id>
	<title>SORT - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=SORT"/>
	<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=SORT&amp;action=history"/>
	<updated>2026-04-09T15:54:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.ice-online.com/index.php?title=SORT&amp;diff=853&amp;oldid=prev</id>
		<title>ConvertBot: Sorts a Type 3000 file.</title>
		<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=SORT&amp;diff=853&amp;oldid=prev"/>
		<updated>2020-04-27T22:05:17Z</updated>

		<summary type="html">&lt;p&gt;Sorts a Type 3000 file.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Sorts a Type 3000 file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IN&amp;gt;      The input file.&lt;br /&gt;
&amp;lt;OUT&amp;gt;     The output file.&lt;br /&gt;
&amp;lt;KEYS&amp;gt;    The keys to sort by (separated by '|').&lt;br /&gt;
&lt;br /&gt;
DESCRIPTION:&lt;br /&gt;
  This will sort a Midas BLUE Type 3000 file. The input file will be read in&lt;br /&gt;
  and then the data will be sorted before writing out to the output file. The&lt;br /&gt;
  provided keys specify which key or keys to sort by. They should be in the&lt;br /&gt;
  form:&lt;br /&gt;
    &amp;lt;KEYS&amp;gt; = &amp;quot;key1|key2|key3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  This will sort with &amp;quot;key1&amp;quot; as the primary key, and &amp;quot;key2&amp;quot; as the secondary&lt;br /&gt;
  key (used where multiple &amp;quot;key1&amp;quot; values match), and so forth.&lt;br /&gt;
&lt;br /&gt;
  This primitive is intended for use with only small data files. The following&lt;br /&gt;
  assumptions were made when the primitive was written:&lt;br /&gt;
    1. The entire file can be read into memory prior to sorting.&lt;br /&gt;
    2. The sort algorithm need not be highly optimized. (Though&lt;br /&gt;
       it is optimized in the current implementation.)&lt;br /&gt;
    3. The keys specified will match the fields in the records.&lt;br /&gt;
    4. All values for a given field will be of the same data type.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SORT ORDER:&lt;br /&gt;
  To &amp;quot;normal&amp;quot;-sort on a key (smallest-to-largest) prefix the key name with a&lt;br /&gt;
  plus sign ('+'), or give it no prefix. Such as:&lt;br /&gt;
    &amp;lt;KEYS&amp;gt; = &amp;quot;+key1|+key2|+key3&amp;quot;   or   &amp;lt;KEYS&amp;gt; = &amp;quot;key1|key2|key3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  To reverse-sort on a key (largest-to-smallest) prefix the key name with a&lt;br /&gt;
  minus sign ('-'). Such as:&lt;br /&gt;
    &amp;lt;KEYS&amp;gt; = &amp;quot;-key1|-key2|-key3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  Mixing the sort order between keys is permitted. Such as:&lt;br /&gt;
    &amp;lt;KEYS&amp;gt; = &amp;quot;key1|-key2|+key3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXAMPLES:&lt;br /&gt;
  1. Sort the 'testxy3000' file based on 'ABSC':&lt;br /&gt;
       nM&amp;gt; sort testxy3000 outfile absc&lt;br /&gt;
&lt;br /&gt;
  2. Sort the 'testxy3000' file based on 'ABSC',in the reverse order&lt;br /&gt;
     sort key (for instances where 'ABSC' values match):&lt;br /&gt;
       nM&amp;gt; sort testxy3000 outfile -absc&lt;br /&gt;
&lt;br /&gt;
  3. Sort a file based on multiple keys:&lt;br /&gt;
       nM&amp;gt; sort inFile outFile &amp;quot;-SINT|-NAME|+SLNG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:NXM_Explain]]&lt;/div&gt;</summary>
		<author><name>ConvertBot</name></author>
		
	</entry>
</feed>