<div dir="ltr"><div>That&#39;s a matter of perspective.  Since I have been a shell script SME (subject matter expert) since the 1980s, using a spreadsheet for something this simple seems like serious overkill.   <br><br></div>Could you eliminate the need to move the heading row after sorting by selecting only the channel rows for sorting?<br><div><br>Is there a way to do multiple key column sorts (e.g. primary sort on Name and secondary on frequency) in Libreoffice calc?<br><br></div><div>(is this going off-topic for this forum?)<br></div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 23, 2016 at 10:24 AM, Ken <span dir="ltr">&lt;<a href="mailto:ken@wa0sbu.com" target="_blank">ken@wa0sbu.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    I may be missing the point Dave, why can&#39;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<div><div class="h5"><br>
    <br>
    <div>On 03/23/2016 08:23 AM, Knight, Dave
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <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&#39;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 [ &quot;x$1&quot; = &quot;x&quot; ]<br>
            then echo &quot;Usage: $0 &lt;chirp_csv_filename&gt;&quot;<br>
                 echo &quot;   Sorts rows by frequency and renumbers them for
            CHIRP import.&quot;<br>
                 echo &quot;   The sorted and renumbered lines are written to
            stdout.&quot;<br>
                 exit 1<br>
            fi<br>
            <br>
            IFN=$1<br>
            sort --field-separator=, -k3n,3 &lt; $IFN | gawk -F\, &#39;<br>
              BEGIN{OFS=&quot;,&quot;}<br>
              $1 != &quot;Location&quot;{$1 = ++n}<br>
              {print $0 }&#39;</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
          &quot;3&quot;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 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>&gt; On Mar 23, 2016, at 6:09 AM, Jim Unroe &lt;<a href="mailto:rock.unroe@gmail.com" target="_blank"></a><a href="mailto:rock.unroe@gmail.com" target="_blank">rock.unroe@gmail.com</a>&gt;
              wrote:<br>
              &gt;<br>
              &gt; On Tue, Mar 22, 2016 at 7:04 PM, Knight, Dave &lt;<a href="mailto:diemkae@gmail.com" target="_blank"></a><a href="mailto:diemkae@gmail.com" target="_blank">diemkae@gmail.com</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&#39; 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>
              <div>_______________________________________________<br>
                chirp_users mailing list<br>
                <a href="mailto:chirp_users@intrepid.danplanet.com" target="_blank">chirp_users@intrepid.danplanet.com</a><br>
                <a 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 href="mailto:diemkae@gmail.com" target="_blank"></a><a href="mailto:diemkae@gmail.com" target="_blank">diemkae@gmail.com</a><br>
                To unsubscribe, send an email to <a href="mailto:chirp_users-unsubscribe@intrepid.danplanet.com" target="_blank"></a><a href="mailto:chirp_users-unsubscribe@intrepid.danplanet.com" target="_blank">chirp_users-unsubscribe@intrepid.danplanet.com</a></div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        <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 dir="ltr">
                                        <div>
                                          <div>
                                            The &quot;Safe in Church&quot;
                                            deception: believing that
                                            calling some building a
                                            &quot;sanctuary&quot; will magically
                                            deter criminal violence is a
                                            dangerous delusion!<br>
                                            <br>
                                            The &quot;Gun-Free Zone&quot;
                                            deception: believing that a
                                            &quot;No Guns&quot; policy or sign
                                            will deter criminal violence
                                            is &quot;magical thinking&quot; 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></fieldset>
      <br>
      </div></div><pre><div><div class="h5">_______________________________________________
chirp_users mailing list
<a href="mailto:chirp_users@intrepid.danplanet.com" target="_blank">chirp_users@intrepid.danplanet.com</a>
<a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_users" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_users</a></div></div>
This message was sent to Ken at <a href="mailto:ken@wa0sbu.com" target="_blank">ken@wa0sbu.com</a><span class="">
To unsubscribe, send an email to <a href="mailto:chirp_users-unsubscribe@intrepid.danplanet.com" target="_blank">chirp_users-unsubscribe@intrepid.danplanet.com</a></span></pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
chirp_users mailing list<br>
<a href="mailto:chirp_users@intrepid.danplanet.com">chirp_users@intrepid.danplanet.com</a><br>
<a 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 href="mailto:diemkae@gmail.com">diemkae@gmail.com</a><br>
To unsubscribe, send an email to <a href="mailto:chirp_users-unsubscribe@intrepid.danplanet.com">chirp_users-unsubscribe@intrepid.danplanet.com</a><br></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>
<p></p>The &quot;Safe in Church&quot; deception: believing that calling some building a &quot;sanctuary&quot; will magically deter criminal violence is a dangerous delusion!<br><br>The &quot;Gun-Free Zone&quot; deception: believing that a &quot;No Guns&quot; policy or sign will deter criminal violence is &quot;magical thinking&quot; 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>