Loading ...
Sorry, an error occurred while loading the content.

How to sort by number?

Expand Messages
  • Brother Gabriel-Marie
    Hello all! Is there a special way to sort a numbered list according to the *value* of the number? And How do I append to file a carriage return? Thanks! -
    Message 1 of 3 , Mar 7, 2009
    • 0 Attachment
      Hello all!

      Is there a special way to sort a numbered list according to the *value*
      of the number?

      And

      How do I "append to file" a carriage return?

      Thanks!
      - Brother Gabriel-Marie
    • loro
      ... I d use Join Lines (Modify menu) to make sure each list item is a single line. Then Sort (on the same menu) should work. ... ^%nl% seems to work, ^p does
      Message 2 of 3 , Mar 7, 2009
      • 0 Attachment
        Brother Gabriel-Marie wrote:
        >Is there a special way to sort a numbered list according to the *value*
        >of the number?

        I'd use Join Lines (Modify menu) to make sure each list item is a
        single line. Then Sort (on the same menu) should work.

        >How do I "append to file" a carriage return?

        ^%nl% seems to work, ^p does not. See the section about variables in Clip Help.

        Lotta
      • Alec Burgess
        Brother Gabriel-Marie (brgabriel@sspx.org) wrote (in part) (on ... I usually use Modify-Lines-AutoNumber and choose a starting number higher than max lines
        Message 3 of 3 , Mar 7, 2009
        • 0 Attachment
          Brother Gabriel-Marie (brgabriel@...) wrote (in part) (on
          2009-03-07 at 18:45):
          >
          > Is there a special way to sort a numbered list according to the
          > *value*
          > of the number?

          I usually use Modify-Lines-AutoNumber and choose a starting number
          higher than max lines eg 1001 if num lines less than 1000. Quick test
          indicates that if you instead start at 1, Notetab will automatically
          insert sufficient spaces so it can be sorted.

          If you already have lines numbered but left justified you can do
          something like this:
          (say largest number is 1234 starting at 1)
          ^!replace "^" >> "0000" rwais
          this gives lines like:
          00001
          000012
          0000123
          00001234
          then
          ^!replace "^(\d+)(\d{4})" >> "$2" rwais

          this has the effect of stripping leading zeros sufficient to leave 4
          digit left-zero filled numbers.

          > And
          >
          > How do I "append to file" a carriage return?

          ^!appendtofile "D:\Temp\NoName01.txt" ^%NL%
          Note: ^%NL% = new line (CR/LF pair) can be found in Help index (thank
          you Sheri - I think she added them).
          I've added to my Favorites in clip script variables a topic I named
          "Preset variables" because I can never remember them!

          --
          Regards ... Alec (buralex@gmail & WinLiveMess - alec.m.burgess@skype)




          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.