<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Alphanumeric sort in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10625995#M55327</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6128698"&gt;@drew_dewit&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;How can i modify this to sort by the first element of the sub lists. I imagine I can insert a CAR but I'm not sure the best way.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;FWIW:&lt;/P&gt;
&lt;PRE&gt;(defun _n (str / s)&lt;BR /&gt;(setq s (vl-string-right-trim "0123456789" str))&lt;BR /&gt;(list s (atoi (substr str (1+ (strlen s)))))&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(Defun &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ThisFunc &lt;/STRONG&gt;&lt;/FONT&gt;(l)
(Vl-sort l'(lambda (n m)
		(setq n (_n &lt;FONT color="#0000FF"&gt;(Car n)&lt;/FONT&gt;) m (_n &lt;FONT color="#0000FF"&gt;(Car m)&lt;/FONT&gt;))
			(cond
			  ((&amp;lt; (Car n) (car m)))
			  ((eq (Car n) (car m)) (&amp;lt; (Cadr n) (cadr m)))
			)
		)
	 )
)
&lt;/PRE&gt;
&lt;PRE&gt;(setq lst '(("A10" "Description" "Rev")(&lt;FONT color="#0000FF"&gt;"U20"&lt;/FONT&gt; "Description" "Rev")(&lt;FONT color="#000000"&gt;"B100"&lt;/FONT&gt; "Description" "Rev")
	    (&lt;FONT color="#0000FF"&gt;"U10"&lt;/FONT&gt; "Description" "Rev")(&lt;FONT color="#800000"&gt;"HE110"&lt;/FONT&gt; "Description" "Rev")(&lt;FONT color="#0000FF"&gt;"U110"&lt;/FONT&gt; "Description" "Rev")
	    (&lt;FONT color="#800000"&gt;"HE2"&lt;/FONT&gt; "Description" "Rev")))

(&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ThisFunc&lt;/STRONG&gt;&lt;/FONT&gt; lst)

("A10" "Description" "Rev") (&lt;FONT color="#000000"&gt;"B100"&lt;/FONT&gt; "Description" "Rev") (&lt;FONT color="#800000"&gt;"HE2"&lt;/FONT&gt; "Description" "Rev")
(&lt;FONT color="#800000"&gt;"HE110"&lt;/FONT&gt; "Description" "Rev")(&lt;FONT color="#0000FF"&gt;"U10"&lt;/FONT&gt; "Description" "Rev") (&lt;FONT color="#0000FF"&gt;"U20"&lt;/FONT&gt; "Description" "Rev")
(&lt;FONT color="#0000FF"&gt;"U110"&lt;/FONT&gt; "Description" "Rev") 
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Sep 2021 04:33:39 GMT</pubDate>
    <dc:creator>pbejse</dc:creator>
    <dc:date>2021-09-16T04:33:39Z</dc:date>
    <item>
      <title>Alphanumeric sort</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10622256#M55319</link>
      <description>&lt;P&gt;I am looking to sort the following list ("U20" "U10"&amp;nbsp;"U110" "U11" "T1" "V1") to first be sorted alphabetically then numerically so that it ends up being ("T1" "U10" "U11" "U20" "U110" "V1")&amp;nbsp; this is the funtion I am currently using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun sort (l)&lt;BR /&gt;(defun sortFunc (m n)&lt;BR /&gt;(&amp;lt; (car m) (car n))&lt;BR /&gt;)&lt;BR /&gt;(vl-sort l 'sortFunc)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works fine till you get to a 3 digit number then it tries to do ("T1" "U10" "U11"&amp;nbsp;"U110" "U20" "V1").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 18:30:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10622256#M55319</guid>
      <dc:creator>drew_dewit</dc:creator>
      <dc:date>2021-09-14T18:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric sort</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10622328#M55320</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6128698"&gt;@drew_dewit&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am looking to sort the following list ("U20" "U10"&amp;nbsp;"U110" "U11" "T1" "V1") to first be sorted alphabetically then&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Suggestion: You need to split them so you can effectively sort the numeric values. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Let us know if you need help with that.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 18:59:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10622328#M55320</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-09-14T18:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric sort</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10622346#M55321</link>
      <description>&lt;P&gt;That would be, I figured that was the route to go but don't have a good grasp on the best way to do that.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 19:05:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10622346#M55321</guid>
      <dc:creator>drew_dewit</dc:creator>
      <dc:date>2021-09-14T19:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric sort</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10622352#M55322</link>
      <description>&lt;P&gt;As &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp; suggests&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(setq lst '("U20" "U10" "U110" "U11" "T1" "V1"))
(foreach e lst(setq ret (cons (list (substr e 1 1)(atoi(substr e 2)))ret)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New list ret is then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(("V" 1) ("T" 1) ("U" 11) ("U" 110) ("U" 10) ("U" 20))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 19:10:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10622352#M55322</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-14T19:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric sort</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10622378#M55323</link>
      <description>&lt;P&gt;If they &lt;EM&gt;always&lt;/EM&gt; start with a &lt;EM&gt;&lt;STRONG&gt;single&lt;/STRONG&gt;&lt;/EM&gt; letter followed by &lt;EM&gt;only numbers representing integers&lt;/EM&gt;, this seems to work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun SortAI (lst); = Sort Alphabetically, and within that by Integer value
  (vl-sort
    (vl-sort lst '(lambda (a b) (&amp;lt; (atoi (substr a 2)) (atoi (substr b 2)))))
    '(lambda (c d) (&amp;lt; (substr c 1 1) (substr d 1 1)))
  )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sorts by the numbers "inside," ignoring the letters and using numerical rather than alphabetical values for the numbers, then "outside" sorts that result by the initial letters, and those entries that share an initial letter stay, among themselves, in the order from the numerically-sorted result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;(setq lst '("U20" "U10" "U110" "U11" "T1" "V1"))&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;(SortAI lst)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;&amp;nbsp; ("T1" "U10" "U11" "U20" "U110" "V1")&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;(setq lst '("F123" "T4" "A23" "Q3450" "F13" "A8" "T1"))&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;(SortAI lst)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;&amp;nbsp; ("A8" "A23" "F13" "F123" "Q3450" "T1" "T4")&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 19:46:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10622378#M55323</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-09-14T19:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric sort</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10622391#M55324</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6128698"&gt;@drew_dewit&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;That would be, I figured that was the route to go but don't have a good grasp on the best way to do that.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One example&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun _n (str / s)
  (setq s (vl-string-right-trim "0123456789" str))
  (list s (atoi (substr str (1+ (strlen s)))))
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;_$ (_n "&lt;STRONG&gt;U&lt;/STRONG&gt;101")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;("U" 101)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;_$ (_n "&lt;STRONG&gt;UBN&lt;/STRONG&gt;101")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;("UBN" 101)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(Defun sortFunc (l)
(Vl-sort l'(lambda (n m)
		(setq n (_n n) m (_n m))
			(cond
			  ((&amp;lt; (Car n) (car m)))
			  ((eq (Car n) (car m)) (&amp;lt; (Cadr n) (cadr m)))
			)
		)
	 )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;_$ (setq lst '("U20" "U10" "U110" "U11" "T1" "V1"))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;("U20" "U10" "U110" "U11" "T1" "V1")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;_$ (&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Acad_strlsort&lt;/STRONG&gt;&lt;/FONT&gt; lst)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;("T1" "U10" "U11" "U110" "U20" "V1")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;_$ (&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;sortFunc&lt;/STRONG&gt;&lt;/FONT&gt; lst)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;("T1" "U10" "U11" "U20" "U110" "V1")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;_$ (setq lst '("U20" "U10" "U110" "U11" "T1" "V1" "HE110" "HE250" "HE2"))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;("U20" "U10" "U110" "U11" "T1" "V1" "HE110" "HE250" "HE2")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;_$ (&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Acad_strlsort&lt;/FONT&gt;&lt;/STRONG&gt; lst)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;("HE110" &lt;STRONG&gt;"HE2"&lt;/STRONG&gt; "HE250" "T1" "U10" "U11" &lt;STRONG&gt;"U110"&lt;/STRONG&gt; "U20" "V1")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;_$ (&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;sortFunc&lt;/FONT&gt;&lt;/STRONG&gt; lst)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;(&lt;STRONG&gt;"HE2"&lt;/STRONG&gt; "HE110" "HE250" "T1" "U10" "U11" "U20" &lt;STRONG&gt;"U110"&lt;/STRONG&gt; "V1")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;HTH&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 19:34:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10622391#M55324</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-09-14T19:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric sort</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10624684#M55325</link>
      <description>&lt;P&gt;Thanks guys,&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this function works&lt;/P&gt;&lt;PRE&gt;(defun SortAI (lst); = Sort Alphabetically, and within that by Integer value
  (vl-sort
    (vl-sort lst '(lambda (a b) (&amp;lt; (atoi (substr a 2)) (atoi (substr b 2)))))
    '(lambda (c d) (&amp;lt; (substr c 1 1) (substr d 1 1)))
  )
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I was wrong in how the list is presented to the function. Its actually a list of lists. So it looks like (("A10" Description" "Rev")("B100" "Description" "Rev" ...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can i modify this to sort by the first element of the sub lists. I imagine I can insert a CAR but I'm not sure the best way.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 15:59:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10624684#M55325</guid>
      <dc:creator>drew_dewit</dc:creator>
      <dc:date>2021-09-15T15:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric sort</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10624975#M55326</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6128698"&gt;@drew_dewit&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;... I was wrong in how the list is presented to the function. Its actually a list of lists. So it looks like (("A10" Description" "Rev")("B100" "Description" "Rev" ...)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can i modify this to sort by the first element of the sub lists. I imagine I can insert a CAR but I'm not sure the best way.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I hope this will do that [untested]:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;(defun SortAI (lst); = Sort Alphabetically, and within that by Integer value &lt;FONT color="#0000FF"&gt;[of first element]&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; (vl-sort&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (vl-sort lst '(lambda (a b) (&amp;lt; (atoi (substr &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;(car&lt;/FONT&gt; &lt;/STRONG&gt;a&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt; 2)) (atoi (substr &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;(car&lt;/FONT&gt; &lt;/STRONG&gt;b&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt; 2)))))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; '(lambda (c d) (&amp;lt; (substr &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;(car&lt;/FONT&gt; &lt;/STRONG&gt;c&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt; 1 1) (substr &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;(car&lt;/FONT&gt; &lt;/STRONG&gt;d&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt; 1 1)))&lt;BR /&gt;&amp;nbsp; )&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 17:27:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10624975#M55326</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-09-15T17:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: Alphanumeric sort</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10625995#M55327</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6128698"&gt;@drew_dewit&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;How can i modify this to sort by the first element of the sub lists. I imagine I can insert a CAR but I'm not sure the best way.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;FWIW:&lt;/P&gt;
&lt;PRE&gt;(defun _n (str / s)&lt;BR /&gt;(setq s (vl-string-right-trim "0123456789" str))&lt;BR /&gt;(list s (atoi (substr str (1+ (strlen s)))))&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(Defun &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ThisFunc &lt;/STRONG&gt;&lt;/FONT&gt;(l)
(Vl-sort l'(lambda (n m)
		(setq n (_n &lt;FONT color="#0000FF"&gt;(Car n)&lt;/FONT&gt;) m (_n &lt;FONT color="#0000FF"&gt;(Car m)&lt;/FONT&gt;))
			(cond
			  ((&amp;lt; (Car n) (car m)))
			  ((eq (Car n) (car m)) (&amp;lt; (Cadr n) (cadr m)))
			)
		)
	 )
)
&lt;/PRE&gt;
&lt;PRE&gt;(setq lst '(("A10" "Description" "Rev")(&lt;FONT color="#0000FF"&gt;"U20"&lt;/FONT&gt; "Description" "Rev")(&lt;FONT color="#000000"&gt;"B100"&lt;/FONT&gt; "Description" "Rev")
	    (&lt;FONT color="#0000FF"&gt;"U10"&lt;/FONT&gt; "Description" "Rev")(&lt;FONT color="#800000"&gt;"HE110"&lt;/FONT&gt; "Description" "Rev")(&lt;FONT color="#0000FF"&gt;"U110"&lt;/FONT&gt; "Description" "Rev")
	    (&lt;FONT color="#800000"&gt;"HE2"&lt;/FONT&gt; "Description" "Rev")))

(&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ThisFunc&lt;/STRONG&gt;&lt;/FONT&gt; lst)

("A10" "Description" "Rev") (&lt;FONT color="#000000"&gt;"B100"&lt;/FONT&gt; "Description" "Rev") (&lt;FONT color="#800000"&gt;"HE2"&lt;/FONT&gt; "Description" "Rev")
(&lt;FONT color="#800000"&gt;"HE110"&lt;/FONT&gt; "Description" "Rev")(&lt;FONT color="#0000FF"&gt;"U10"&lt;/FONT&gt; "Description" "Rev") (&lt;FONT color="#0000FF"&gt;"U20"&lt;/FONT&gt; "Description" "Rev")
(&lt;FONT color="#0000FF"&gt;"U110"&lt;/FONT&gt; "Description" "Rev") 
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 04:33:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/alphanumeric-sort/m-p/10625995#M55327</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-09-16T04:33:39Z</dc:date>
    </item>
  </channel>
</rss>

