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

Insert blank line between every line of text

Expand Messages
  • chris_mclean1954
    I have been directed to this group by NoteTab support. I sent them a question asking if it is possible to tell NoteTab to insert a blank line between every
    Message 1 of 11 , Oct 5, 2008
    • 0 Attachment
      I have been directed to this group by NoteTab support. I sent them a
      question asking if it is possible to tell NoteTab to insert a blank
      line between every line of text in a text document. They told me that
      it is a simple thing to do with a clip. However, until I got this
      message I had never even heard of clips, so you can see that I am a
      total beginner at this.

      Can anyone tell me whether it is possible for a complete beginner, only
      using the Help function within Notetab, to create (or even use) a Clip
      to do this? If it is possible, any help with doing this would be
      greatly appreciated.

      I am formatting text for viewing in a small Personal Media Player
      (Cowon D2). I set the text to 45 characters width, and find that it is
      much easier to read if there is a blank line between each line of text.

      thanks,

      Chris McLean
    • Axel Berger
      ... But you ve seen them. After your first installation there was a column to the left of your text area. Double-clicking any of its items will run a short
      Message 2 of 11 , Oct 5, 2008
      • 0 Attachment
        chris_mclean1954 wrote:
        > However, until I got this message I had never even heard
        > of clips,

        But you've seen them. After your first installation there was a
        column to the left of your text area. Double-clicking any of its
        items will run a short script on your text. At the bottom there is a
        selection of clip files, one of which is the active one seen in the
        column.

        What you want is very easy to achieve without a clip. Just replace
        "^P" with "^P^P" (^P, two characters, is a shortcut for newline, in
        DOS and Windows <CR><LF>, but NoteTab can work on texts with
        different conventions) through the search and replace menu item. If
        you need to do that often, then activate any of the clip files,
        right click in the column and choose "Add new clip". Choose a name
        like "Doublespace" or whatever. In the editing window type the
        single line:

        ^!Replace "^P" >> "^P^P" HWAS

        and save. Open any text and double click your newly created
        "Doublespace". The modifiers mean:
        - only work inside >H<ighlighted area if there is any
        - work on the >w<hole text, i.e. from beginning not from cursor
        - replace >A<ll occurrences
        - run >s<ilently, i.e. no alert boxes while running

        You have missed the main reason why NoteTab is superiour to other
        editors. Be prepared to become more amazed the more you learn.

        Axel
      • Alec Burgess
        chris_mclean1954 (chris_mclean@picknowl.com.au) wrote (in part) (on ... Hi Chris: You can do this w/o using a clip at all ... Just go to Replace dialog and
        Message 3 of 11 , Oct 5, 2008
        • 0 Attachment
          chris_mclean1954 (chris_mclean@...) wrote (in part) (on
          2008-10-05 at 03:09):
          > I have been directed to this group by NoteTab support. I sent them a
          > question asking if it is possible to tell NoteTab to insert a blank
          > line between every line of text in a text document. They told me that
          > it is a simple thing to do with a clip. However, until I got this
          > message I had never even heard of clips, so you can see that I am a
          > total beginner at this.
          >
          > Can anyone tell me whether it is possible for a complete beginner,
          > only
          > using the Help function within Notetab, to create (or even use) a Clip
          > to do this? If it is possible, any help with doing this would be
          > greatly appreciated.
          >
          > I am formatting text for viewing in a small Personal Media Player
          > (Cowon D2). I set the text to 45 characters width, and find that it is
          > much easier to read if there is a blank line between each line of
          > text.
          Hi Chris:
          You can do this w/o using a clip at all ...
          Just go to Replace dialog and replace all occurrences of ^P by ^P^P (^P
          is a token that represents a line-feed) so this will turn single-spaced
          lines into double-spaced.

          Note: any blank lines would be turned into four blank lines - if you
          want (say) to change those to only two blank lines you could replace all
          ^P^P^P^P by ^P^P^P

          If you want to do more complicated text processing then you may want to
          start learning how to use clips to do so. I just had a look at the top
          of the Help-Help on Clip Processing and I think its possible to learn
          how by reading it, especially if you've done programming or scripting in
          any language before.

          Its worth looking at the clips in the sample clips library as models or
          just to see how certain tasks can be done.

          If/when you want to tackle the bigger jobs feel free to come back and
          ask for help or even for a clip to do a specific job. We're a friendly
          group :-)

          Several years ago, Jody Alistair (RIP) wrote a 6 part (originally
          intended to be 10 parts) lesson/tutorial. I'm sure its still available
          somewhere in or under the Notetab web site but can't find it at the moment.

          Maybe someone else knows where to locate it?

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




          [Non-text portions of this message have been removed]
        • Flo
          ... Alec, Why don t you write... ^!Replace . K r n(?! r n| Z) r n r n AWRS ...to prevent empty lines from being doubled? Flo  
          Message 4 of 11 , Oct 5, 2008
          • 0 Attachment
            --- In ntb-clips@yahoogroups.com, Alec Burgess <buralex@...> wrote:
            >
            > Note: any blank lines would be turned into four blank lines -
            > if you want (say) to change those to only two blank lines you
            > could replace all ^P^P^P^P by ^P^P^P

            Alec,

            Why don't you write...

            ^!Replace ".\K\r\n(?!\r\n|\Z)" >> "\r\n\r\n" AWRS

            ...to prevent empty lines from being doubled?

            Flo
             
          • Don - HtmlFixIt.com
            ... Okay, I give? . K is what? anything but a line end? (?! r n| Z) is not followed by another return or by file end? Is Z a file end. ... I tried to
            Message 5 of 11 , Oct 5, 2008
            • 0 Attachment
              Flo wrote:
              > --- In ntb-clips@yahoogroups.com, Alec Burgess <buralex@...> wrote:
              >> Note: any blank lines would be turned into four blank lines -
              >> if you want (say) to change those to only two blank lines you
              >> could replace all ^P^P^P^P by ^P^P^P
              >
              > Alec,
              >
              > Why don't you write...
              >
              > ^!Replace ".\K\r\n(?!\r\n|\Z)" >> "\r\n\r\n" AWRS
              >
              > ...to prevent empty lines from being doubled?
              >
              > Flo

              Okay, I give?
              .\K is what? anything but a line end?
              (?!\r\n|\Z)
              is not followed by another return or by file end? Is \Z a file end.
              | means or, correct?

              I tried to understand it by just reading it instead of looking things up
              as I usually do. I'm willing to get out the book again but figure you
              just know such things cause you're smart!

              DP
            • Don - HtmlFixIt.com
              ... So do that first and then when you finish you run this: replace ^P^P^P with ^P^P and re-run it until you get no replacements. So first all are doubled and
              Message 6 of 11 , Oct 5, 2008
              • 0 Attachment
                > Hi Chris:
                > You can do this w/o using a clip at all ...
                > Just go to Replace dialog and replace all occurrences of ^P by ^P^P (^P
                > is a token that represents a line-feed) so this will turn single-spaced
                > lines into double-spaced.
                >
                > Note: any blank lines would be turned into four blank lines - if you
                > want (say) to change those to only two blank lines you could replace all
                > ^P^P^P^P by ^P^P^P

                So do that first and then when you finish you run this:
                replace ^P^P^P with ^P^P and re-run it until you get no replacements.

                So first all are doubled and then all greater than doubled are reduced
                back to doubles.

                A regex will do it as suggested by Flo no doubt, but regex is hugely
                confusing to many beginners (and to me whatever I am -- though I'm
                improving).
              • Flo
                ... Don, Regarding K: Do Kn , for example, matches Don but returns the n only. We could also use a Positive Lookbehind Assertion (?
                Message 7 of 11 , Oct 5, 2008
                • 0 Attachment
                  --- In ntb-clips@yahoogroups.com, "Don - HtmlFixIt.com" <don@...>
                  wrote:
                  >
                  > Okay, I give?
                  > .\K is what? anything but a line end?
                  > (?!\r\n|\Z)
                  > is not followed by another return or by file end? Is \Z a file end.
                  > | means or, correct?...

                  Don,

                  Regarding \K: "Do\Kn", for example, matches "Don" but returns the "n"
                  only. We could also use a Positive Lookbehind Assertion "(?<=Do)n"
                  ("Do" preceding "n") but I like \K because it's shorter and, in
                  different cases, it doesn't a demand a fixed length of the pattern.
                  It just "dismisses" anything that precedes \K.

                  ".\K\r\n(?!\r\n|\Z)" matches any single character "." followed by a
                  CR/NL without selecting (and replacing) this character. The CR/NL
                  must not be followed by another CR/NL (Negative Lookahead Assertion).
                  So the replacing doubles any CR/NL but skips over CR/NL in empty
                  lines.

                  If we've got an empty line following the last CR/NL, also this CR/NL
                  would be doubled because we've got a single character, a CR/NL and no
                  following CR/NL. To prevent this, an alternative \Z (matches at end
                  of string) is used as part of the Assertion (no CR/NL at end of
                  string).

                  Flo
                   
                • Alec Burgess
                  ... Flo: Yes, some regex answer is of course the first thing that I would use my self but I deliberately wanted to avoid introducing regular expression to a
                  Message 8 of 11 , Oct 5, 2008
                  • 0 Attachment
                    Flo (flo.gehrke@...) wrote (in part) (on 2008-10-05 at 14:48):
                    > --- In ntb-clips@yahoogroups.com, Alec Burgess <buralex@...> wrote:
                    > >
                    > > Note: any blank lines would be turned into four blank lines -
                    > > if you want (say) to change those to only two blank lines you
                    > > could replace all ^P^P^P^P by ^P^P^P
                    >
                    > Alec,
                    >
                    > Why don't you write...
                    >
                    > ^!Replace ".\K\r\n(?!\r\n|\Z)" >> "\r\n\r\n" AWRS
                    >
                    > ...to prevent empty lines from being doubled?

                    Flo: Yes, some regex answer is of course the first thing that I would
                    use my self but I deliberately wanted to avoid introducing regular
                    expression to a new user from the get-go ;-)

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




                    [Non-text portions of this message have been removed]
                  • Chris McLean
                    Thankyou to everyone who replied to my question about inserting blank lines. It will take me a while to work through the information and see if I can make
                    Message 9 of 11 , Oct 5, 2008
                    • 0 Attachment
                      Thankyou to everyone who replied to my question about inserting blank lines. It will take me a while to work through the information and see if I can make sense of it. In the meantime - thanks for your help.
                      Chris McLean


                      [Non-text portions of this message have been removed]
                    • bruce.somers@web.de
                      Insert blank line between every line of text is without meaning. Do you mean after each line of text or between each pair of successive lines of text ?
                      Message 10 of 11 , Oct 6, 2008
                      • 0 Attachment
                        "Insert blank line between every line of text" is without meaning.

                        Do you mean "after each line of text" or "between each pair of successive lines of text"?

                        English can be neater and cleaner than you realize.

                        Bruce
                      • Flo
                        ... Here s another one that true RegEx-aesthetes certainly would prefer... ^!Replace (?
                        Message 11 of 11 , Oct 13, 2008
                        • 0 Attachment
                          --- In ntb-clips@yahoogroups.com, "Flo" <flo.gehrke@...> wrote:
                          >
                          > Alec,
                          >
                          > Why don't you write...
                          >
                          > ^!Replace ".\K\r\n(?!\r\n|\Z)" >> "\r\n\r\n" AWRS
                          >
                          > ...to prevent empty lines from being doubled?
                          >
                          > Flo

                          Here's another one that true RegEx-aesthetes certainly would prefer...

                          ^!Replace "(?<!^)\r\n(?!\r\n|\Z)" >> "\r\n\r\n" AWRS

                          Matches a CR/NL which is not positioned at start of a line (i.e. in
                          an empty line) and which is not followed by another CR/NL or which is
                          not positioned at end of subject (\Z), followed by an empty line.

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