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

Re: [NTB] Modify Lines - Reverse?

Expand Messages
  • Alec Burgess
    Manuel,Trish The example Trish provided {apples, peaches, plums) happened to be in alphabetic order so Manuel s method will work but if you need to reverse an
    Message 1 of 4 , Sep 30, 2001
    • 0 Attachment
      Manuel,Trish
      The example Trish provided {apples, peaches, plums) happened to be in
      alphabetic order so Manuel's method will work but if you need to reverse an
      unordered list I think some kind of clip would be needed. If that's what you
      needed Trish maybe you should repost on the clips list.
      Regards ... Alec
      ----- Original Message -----
      From: "Manuel_123" <manuel123@...>
      To: <notetab@yahoogroups.com>
      Sent: 30 September, 2001 16:35
      Subject: Re: [NTB] Modify Lines - Reverse?
    • Harvey R. Savage
      ... Hi Trish, I think this clip is what you wanted. It reverses the order of lines in a file without a descending sort. Add clip to a library of your choice,
      Message 2 of 4 , Oct 1, 2001
      • 0 Attachment
        otirsh@... wrote:
        >
        > Hi,
        >
        > Help? How do I reverse the order of lines of a text document in
        > notetab ?
        >
        > i.e.
        >
        > transform this:
        >
        > apples
        > peaches
        > plums
        >
        > into this:
        >
        > plums
        > peaches
        > apples
        >
        > Great program.
        > Like the new clip bar that I found in my most recent update.
        >
        > Trish
        >

        Hi Trish,

        I think this clip is what you wanted. It reverses the order of
        lines in a file without a descending sort.

        Add clip to a library of your choice, load the file you want to
        reverse and run the clip.

        It is written to create a new file, with the lines reversed,
        without altering the parent file.

        Word wrap is turned off in case you have any long lines.

        Toward the end of the clip, before the AppendTofile line, 2
        instruction lines tell how to preserve, or not, blank lines.

        Take care that the Append line doesn't get wrapped after you add
        the clip to a library.


        h="reverse line order"
        ^!SetWordWrap OFF
        ^!Set %linecount%=^$GetTextLineCount$
        ^!Set %index%=^$GetTextLineCount$
        :LOOP
        ^!If ^%index% = 0 END
        ^!Jump ^%index%
        ^!IfError END
        ^!Select Line
        ^!SetClipboard ^$GetSelection$
        ;^!DeleteLine
        ^!Dec %index%
        ;- to remove blank lines from finished file
        ;- remove comment/; from next line
        ;^!If ^$GetSelection$ = "" LOOP
        ^!AppendToFile "^$GetDocumentPath$reverse_line_order.txt"
        ^$GetClipboard$
        ;
        ^!Goto LOOP
        :END
        ^!Open ^$GetDocumentPath$reverse_line_order.txt
        ^!SetWordWrap On


        hrs
      Your message has been successfully submitted and would be delivered to recipients shortly.