<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I may be missing the point Dave, why can't you open foo.csv in
    Libreoffice calc, sort by column 3, the frequency column.  Move the
    header back to the top?  Easier than trying to understand a Script.<br>
    <br>
     Ken<br>
    <br>
    <div class="moz-cite-prefix">On 03/23/2016 08:23 AM, Knight, Dave
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAOmkcGtL_Y25kDwooWc0UxGJtg_MUxCNxqKpLVW69Lg6ME=bKA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>My point exactly, thanks!<br>
          <br>
          There are many good reasons to sort channels.  <br>
          <br>
          Periodically, I download the channels to CHIRP for editing
          (it's easier than on the HT) sorting** and printing, then
          upload the reorganized channels to the HT. <br>
          <br>
        </div>
        <div>FWIW, I wrote the following (bash shell script) to sort
          CHIRP-exported .csv files by repeater frequency:<br>
          <br>
          <font size="1">#!/bin/bash<br>
            #<br>
            #  sortBaofeng - sorts chirp .csv file by frequency (field
            3) and renumbers<br>
            #                the lines (filed 1) for import.<br>
            #<br>
            #  FWIW, by clicking on the column name, CHIRP sorts the
            rows by that column,<br>
            #  but does not renumber the rows.<br>
            #<br>
            if [ "x$1" = "x" ]<br>
            then echo "Usage: $0 &lt;chirp_csv_filename&gt;"<br>
                 echo "   Sorts rows by frequency and renumbers them for
            CHIRP import."<br>
                 echo "   The sorted and renumbered lines are written to
            stdout."<br>
                 exit 1<br>
            fi<br>
            <br>
            IFN=$1<br>
            sort --field-separator=, -k3n,3 &lt; $IFN | gawk -F\, '<br>
              BEGIN{OFS=","}<br>
              $1 != "Location"{$1 = ++n}<br>
              {print $0 }'</font><br>
          <br>
        </div>
        <div>and use it thus:<br>
          <br>
        </div>
        <div>  1 - download radio channels to CHIRP<br>
            2 - edit to add/remove channels as necessary<br>
        </div>
        <div>  3 - export to foo.csv<br>
        </div>
        <div>  4 - run the script (sortByFreq) on the .csv file:<br>
          <br>
        </div>
        <div>         sortByFreq  foo.csv  &gt; new.csv<br>
          <br>
        </div>
        <div>  5 - print new.csv<br>
            6 - import new.csv into CHIRP<br>
            7 - upload channels to radio<br>
          <br>
        </div>
        <div>To modify the script to sort by another column, change the
          "3"s in the key (-kn3,3) to the number of the .csv column you
          want.<br>
        </div>
        <div><br>
        </div>
        <div>Steps 3 - 6 of this convoluted, external-to-chirp process
          would be obviated if CHIRP supported options to print, save
          and upload the channels after sorting.   <br>
          <br>
        </div>
        <div>Until then, I hope the above script &amp; process might be
          useful to other CHIRP users.<br>
        </div>
        <div>  <br>
        </div>
        <div><br>
          <br>
        </div>
        <div><br>
          <br>
          <br>
        </div>
        <br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, Mar 23, 2016 at 7:52 AM, Fred
          Maxwell <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:_chirp@mail2fm.com" target="_blank">_chirp@mail2fm.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex"><span
              class="">&gt; On Mar 23, 2016, at 6:09 AM, Jim Unroe &lt;<a
                moz-do-not-send="true"
                href="mailto:rock.unroe@gmail.com"><a class="moz-txt-link-abbreviated" href="mailto:rock.unroe@gmail.com">rock.unroe@gmail.com</a></a>&gt;
              wrote:<br>
              &gt;<br>
              &gt; On Tue, Mar 22, 2016 at 7:04 PM, Knight, Dave &lt;<a
                moz-do-not-send="true" href="mailto:diemkae@gmail.com"><a class="moz-txt-link-abbreviated" href="mailto:diemkae@gmail.com">diemkae@gmail.com</a></a>&gt;
              wrote:<br>
              &gt;&gt; After clicking on a column heading to sort the
              chirp entries, the new sort<br>
              &gt;&gt; order is lost on upload or save.<br>
              &gt;&gt;<br>
              &gt;&gt; Please advise how I can save/upload sorted rows.<br>
              &gt;<br>
              &gt; Which column are you sorting by? What would be the
              reason that you<br>
              &gt; what the channel rows not to be in the same order
              that they are in the<br>
              &gt; radio?<br>
              &gt;<br>
              <br>
            </span>What I believe that Dave wants is the ability to lock
            the memory location column order and sort everything else so
            as to reorder how the channels that  will be programmed into
            the radio. I’ll join in saying that would be a good feature.<br>
            <br>
            A user with dozens of repeaters might want them to be
            programmed into the radio sorted by repeater Name for easy
            location (clockwise rotation of the ‘channel' knob steps
            through alphabetically).  Or someone with a dual-band, or
            tri-band radio might want them sorted by frequency so that
            the bands are separated into memory blocks.  Or someone
            might want to group all of the entries by Duplex to separate
            out repeaters from simplex frequencies.<br>
            <br>
            In my case, I sort by distance from my home — the higher the
            memory location number, the further from my home base
            station (and CHIRP does not support RepeaterBook queries by
            proximity; issue 3261).  That forces me into a tedious
            off-line process involving two RepeaterBook queries, one in
            CHIRP format CSV and one in native RepeaterBook CSV, and
            then going through contortions in a spreadsheet.  I won’t go
            into detail and turn this into a threadjacking, but it’s
            another example of how one might want to sort.<br>
            <br>
            Hope that was of some assistance in explaining what was
            wanted.  (Dave, if I screwed anything up, please let me
            know.)<br>
            <br>
            Regards,<br>
              Fred<br>
              KM4QLB<br>
            <div class="HOEnZb">
              <div class="h5">_______________________________________________<br>
                chirp_users mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:chirp_users@intrepid.danplanet.com">chirp_users@intrepid.danplanet.com</a><br>
                <a moz-do-not-send="true"
                  href="http://intrepid.danplanet.com/mailman/listinfo/chirp_users"
                  rel="noreferrer" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_users</a><br>
                This message was sent to Dave Knight at <a
                  moz-do-not-send="true" href="mailto:diemkae@gmail.com"><a class="moz-txt-link-abbreviated" href="mailto:diemkae@gmail.com">diemkae@gmail.com</a></a><br>
                To unsubscribe, send an email to <a
                  moz-do-not-send="true"
                  href="mailto:chirp_users-unsubscribe@intrepid.danplanet.com"><a class="moz-txt-link-abbreviated" href="mailto:chirp_users-unsubscribe@intrepid.danplanet.com">chirp_users-unsubscribe@intrepid.danplanet.com</a></a></div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        <div class="gmail_signature">
          <div dir="ltr">
            <div>
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div>
                          <div dir="ltr">
                            <div>
                              <div dir="ltr">
                                <div>
                                  <div dir="ltr">
                                    <div>
                                      <div dir="ltr">
                                        <div>
                                          <div>
                                            The "Safe in Church"
                                            deception: believing that
                                            calling some building a
                                            "sanctuary" will magically
                                            deter criminal violence is a
                                            dangerous delusion!<br>
                                            <br>
                                            The "Gun-Free Zone"
                                            deception: believing that a
                                            "No Guns" policy or sign
                                            will deter criminal violence
                                            is "magical thinking" in its
                                            most dangerous form!<br>
                                            <br>
                                            In your time of need, may
                                            your piece be with you!</div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
chirp_users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:chirp_users@intrepid.danplanet.com">chirp_users@intrepid.danplanet.com</a>
<a class="moz-txt-link-freetext" href="http://intrepid.danplanet.com/mailman/listinfo/chirp_users">http://intrepid.danplanet.com/mailman/listinfo/chirp_users</a>
This message was sent to Ken at <a class="moz-txt-link-abbreviated" href="mailto:ken@wa0sbu.com">ken@wa0sbu.com</a>
To unsubscribe, send an email to <a class="moz-txt-link-abbreviated" href="mailto:chirp_users-unsubscribe@intrepid.danplanet.com">chirp_users-unsubscribe@intrepid.danplanet.com</a></pre>
    </blockquote>
    <br>
  </body>
</html>