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

Re: [Clip] Convert "Daniel Prince" into "Prince, Daniel"

Expand Messages
  • Alec Burgess
    try this one-liner: ^!replace {Daniel} s{Prince} 2, 1 rwsa Regards ... Alec -- ... From: Daniel Prince To:
    Message 1 of 19 , May 1, 2004
    • 0 Attachment
      try this one-liner:

      ^!replace "{Daniel}\s{Prince}" >> "\2,\1" rwsa

      Regards ... Alec
      --

      ---- Original Message ----
      From: "Daniel Prince" <neutrino1@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: Saturday, May 01, 2004 05:22
      Subject: [gla: [Clip] Convert "Daniel Prince" into "Prince, Daniel"

      > Has anyone ever written a clip that could convert the selected text
      > "Daniel Prince" into "Prince, Daniel"? Thank you in advance for all
      > replies.
    • Daniel Prince
      ... I guess I did not make myself clear. What I really want is a clip that will do the conversion to any name. I frequently see names of authors recommended
      Message 2 of 19 , May 1, 2004
      • 0 Attachment
        On Sat, 1 May 2004 06:22:11 -0400, you wrote:

        >try this one-liner:
        >
        >^!replace "{Daniel}\s{Prince}" >> "\2,\1" rwsa

        I guess I did not make myself clear. What I really want is a clip that
        will do the conversion to any name. I frequently see names of authors
        recommended in newsgroups in the (first name last name) format but my
        library's web page needs names (last name comma first name). I want to
        be able to just select a name and have the clip convert it.
        --
        Whenever I hear or think of the song "Great green gobs of greasy
        grimey gopher guts" I imagine my cat saying; "That sounds REALLY,
        REALLY good. I'll have some of that!"
      • Jody
        Hi Daniel, I ll give it a try. :) Select the names. If there is more than one space between them it will remove the extras. Take out the + sign if you don t
        Message 3 of 19 , May 1, 2004
        • 0 Attachment
          Hi Daniel,

          I'll give it a try. :) Select the names. If there is more than
          one space between them it will remove the extras. Take out the
          "+" sign if you don't want that.

          ^!Replace "{.*},\s+{.*}" >> "\2, \1" RH

          Here's a freebie. :)
          ^$StrCapitalize("^$GetSelection$")$

          >>^!replace "{Daniel}\s{Prince}" >> "\2,\1" rwsa
          >
          >I guess I did not make myself clear. What I really want is a clip that
          >will do the conversion to any name.


          Happy Clip'n!
          Jody

          www.clean-funnies.com, http://www.fookes.us/maillist.htm

          Subscribe: mailto:ntb-Clips-Subscribe@yahoogroups.com
          UnSubscribe: mailto:ntb-Clips-UnSubscribe@yahoogroups.com
          Options: http://groups.yahoo.com/group/ntb-clips
        • Jody
          Hi Daniel, Take out the comma on the find side. ... Take care, Jody Adair The whole world doth err save you and me, and even thou doest err some!
          Message 4 of 19 , May 1, 2004
          • 0 Attachment
            Hi Daniel,

            Take out the comma on the find side. <g>

            >I'll give it a try. :) Select the names. If there is more than
            >one space between them it will remove the extras. Take out the
            >"+" sign if you don't want that.
            >
            >^!Replace "{.*},\s+{.*}" >> "\2, \1" RH
            >
            >Here's a freebie. :)
            >^$StrCapitalize("^$GetSelection$")$


            Take care,
            Jody Adair

            The whole world doth err save you and me,
            and even thou doest err some!
            http://clean-funnies.com
            http://notetab.net, http://fookes.us
          • Don Daugherty
            ... Try this as a one line clip: ^!Replace {[a-zA-Z]+} s{[a-zA-Z]+} 2, 1 RHI
            Message 5 of 19 , May 1, 2004
            • 0 Attachment
              > I guess I did not make myself clear. What I really want is a clip that
              > will do the conversion to any name. I frequently see names of authors
              > recommended in newsgroups in the (first name last name) format but my
              > library's web page needs names (last name comma first name). I want to
              > be able to just select a name and have the clip convert it.

              Try this as a one line clip: ^!Replace "{[a-zA-Z]+}\s{[a-zA-Z]+}" >> "\2,
              \1" RHI
            • Jeff Scism
              ^!Replace {.*}, s+{.*} 2, 1 RH Here s a freebie. ^$StrCapitalize( ^$GetSelection$ )$ Nice, but it leaves in the comma... Jeff
              Message 6 of 19 , May 1, 2004
              • 0 Attachment
                ^!Replace "{.*},\s+{.*}" >> "\2, \1" RH

                Here's a freebie.
                ^$StrCapitalize("^$GetSelection$")$

                Nice, but it leaves in the comma...

                Jeff
              • Jeff Scism
                I am convertinmg a LOT of pages to a space saving format (preformatting and doing virtual includes) is there a quickie clip that selects everything before
                Message 7 of 19 , May 1, 2004
                • 0 Attachment
                  I am convertinmg a LOT of pages to a space saving format (preformatting
                  and doing virtual includes) is there a quickie clip that selects
                  everything before the (and including) the </head> code, so I can drop
                  in a global replacement?n I am using the Control D (Directory replace)
                  replacement function in NT Standard.

                  (I also want to have it seek and delete all included between "<form...>
                  >> </FORM> to remove 5000 freefind search blocks, since I an
                  including that as a vertual HTML include.

                  --
                  ``

                  Jeffery G. Scism. IBSSG

                  Genealogy is the art of the living haunting the dead,
                  If we persist perhaps they will become annoyed
                  and tell us what REALLY happened.
                  ~~~~
                • Jody
                  Hi Jeff, That s why I posted again saying to take out the comma. I was playing with it before I sent it watching it switch back and forth with the comma.
                  Message 8 of 19 , May 1, 2004
                  • 0 Attachment
                    Hi Jeff,

                    That's why I posted again saying to take out the comma. I was playing
                    with it before I sent it watching it switch back and forth with the comma. <g>

                    >^!Replace "{.*}\s+{.*}" >> "\2, \1" RH
                    >
                    >Here's a freebie.
                    >^$StrCapitalize("^$GetSelection$")$
                    >
                    >Nice, but it leaves in the comma...


                    See ya in the funnies!
                    Jody

                    ...he that is of a merry heart hath a continual feast...
                    http://www.clean-funnies.com

                    If you haven't laughed at yourself today,
                    you missed a good joke! 8D

                    The NoteTabbers Assistant Page
                    http://www.notetab.net


                    [Non-text portions of this message have been removed]
                  • Daniel Prince
                    ... I forgot about this for a while because of health problems. I just now tried to use it and I can t get it to work. How do I add this clip to my utilities
                    Message 9 of 19 , Dec 8, 2004
                    • 0 Attachment
                      On Sat, 01 May 2004 17:26:12 -0500, Jody Adair wrote:

                      >Hi Daniel,
                      >
                      >Take out the comma on the find side. <g>
                      >
                      >>I'll give it a try. :) Select the names. If there is more than
                      >>one space between them it will remove the extras. Take out the
                      >>"+" sign if you don't want that.
                      >>
                      >>^!Replace "{.*},\s+{.*}" >> "\2, \1" RH
                      >>
                      >>Here's a freebie. :)
                      >>^$StrCapitalize("^$GetSelection$")$
                      >
                      >
                      >Take care,
                      >Jody Adair

                      I forgot about this for a while because of health problems. I just
                      now tried to use it and I can't get it to work.

                      How do I add this clip to my utilities library and how do I use it?
                      Thank you for your help.
                      --
                      I am TERRIBLY cruel to my cat. I tease him with a vine tendril
                      until he either jumps up in the air to bat at it or zooms around
                      in a circle until he gets too dizzy to stand up. What is cruel about
                      it is that I don't do it nearly as much as he wants me to.
                    • Don - htmlfixit.com
                      ... How to use a clip is something they assumed we all intuitively knew I guess. You copy the clip to your windows clipboard (I highlight it, then hold down
                      Message 10 of 19 , Dec 8, 2004
                      • 0 Attachment
                        > I forgot about this for a while because of health problems. I just
                        > now tried to use it and I can't get it to work.
                        >
                        > How do I add this clip to my utilities library and how do I use it?
                        > Thank you for your help.

                        How to use a clip is something they assumed we all intuitively knew I guess.
                        You copy the clip to your windows clipboard (I highlight it, then hold
                        down control while hitting c -- as in copy).
                        Then with the utilities library open, right click where the clips are
                        shown and choose "add from clipboard". Your clip is then in the
                        utilities library. To use it in this case it appears you then need to
                        select a name in an open document, and then double click on the clip in
                        the library pane. That should reverse the names and put the comma
                        between them.

                        Note: if you put clips in the standard notetab libraries, they may be
                        over-written in future updates, so it is always advisable to keep a
                        back-up copy in your own library which can be created by right clicking
                        in the library drop down text box and right clicking, choose add library
                        and you are off to the races. Repeat the above steps to copy it in there.

                        This clip doesn't have long lines, but when copying you sometimes need
                        to rejoin long lines.
                      • Daniel Prince
                        ... That is what I have been doing but all I get is an error message saying: {.*}, s+{.*} not found within selected text. I just discovered that the one I
                        Message 11 of 19 , Dec 8, 2004
                        • 0 Attachment
                          On Wed, 08 Dec 2004 13:24:54 -0500, you wrote:

                          >
                          >> I forgot about this for a while because of health problems. I just
                          >> now tried to use it and I can't get it to work.
                          >>
                          >> How do I add this clip to my utilities library and how do I use it?
                          >> Thank you for your help.
                          >
                          >How to use a clip is something they assumed we all intuitively knew I guess.
                          >You copy the clip to your windows clipboard (I highlight it, then hold
                          >down control while hitting c -- as in copy).
                          >Then with the utilities library open, right click where the clips are
                          >shown and choose "add from clipboard". Your clip is then in the
                          >utilities library. To use it in this case it appears you then need to
                          >select a name in an open document, and then double click on the clip in
                          >the library pane. That should reverse the names and put the comma
                          >between them.

                          That is what I have been doing but all I get is an error message
                          saying:

                          "{.*},\s+{.*}" not found within selected text.

                          I just discovered that the one I had managed to get into the library
                          was the one with the comma. Once I took out the comma it worked but
                          I get strange results if I select a few spaces beyond the name. For
                          example:

                          "China Miéville "

                          becomes:

                          " , China Miéville"

                          Is there any way to avoid this?

                          It looks as if this command I found in the help file should be able
                          to do it but I have not yet figured out how. Here is the command:

                          ^$StrTrim("Str")$
                          Removes blank spaces from the start and end of the specified value.
                          Example:
                          ^$StrTrim(" some text ")$ returns "some text"

                          Can I use this to avoid the problem with the extra spaces in the
                          selection?


                          I have decided I want to change the name this way:

                          China Miéville

                          to

                          Miéville, China China Miéville


                          so I changed the clip to this:

                          H="First last to last, first"
                          ^!SetCode %KeepText%=^$GetSelection$
                          ^!Replace "{.*}\s+{.*}" >> "\2, \1" RH

                          ^!InsertCode ^%KeepText%

                          It works but there is one problem. Things do not line up properly.
                          I have tried both tab characters and spaces in the line that looks
                          blank above but things still do not line up. Here is a sample:

                          Miéville, China China Miéville
                          Sawyer, Robert J. Robert J. Sawyer
                          Bujold, Lois McMaster Lois McMaster Bujold
                          Simmons, Dan Dan Simmons
                          Brin, David David Brin

                          Is there a way to get the second column to line up regardless of the
                          length of the name?

                          --
                          I am TERRIBLY cruel to my cat. I tease him with a vine tendril
                          until he either jumps up in the air to bat at it or zooms around
                          in a circle until he gets too dizzy to stand up. What is cruel about
                          it is that I don't do it nearly as much as he wants me to.
                        • Don - htmlfixit.com
                          ... I guess the question is what exactly are you trying to do? Give us 15 lines of the input and 15 lines of the desired output. Is this a list of only names?
                          Message 12 of 19 , Dec 9, 2004
                          • 0 Attachment
                            > It works but there is one problem. Things do not line up properly.
                            > I have tried both tab characters and spaces in the line that looks
                            > blank above but things still do not line up. Here is a sample:
                            >
                            > Miéville, China China Miéville
                            > Sawyer, Robert J. Robert J. Sawyer
                            > Bujold, Lois McMaster Lois McMaster Bujold
                            > Simmons, Dan Dan Simmons
                            > Brin, David David Brin
                            >
                            > Is there a way to get the second column to line up regardless of the
                            > length of the name?

                            I guess the question is what exactly are you trying to do?
                            Give us 15 lines of the input and 15 lines of the desired output.
                            Is this a list of only names? If so why highlight anything.
                            Notetab is a plain text editor, so if you put a tab between things, that
                            won't hold it in staight columns necessarily.
                            If you put a set of spaces of set length, then it will look like the
                            above. You can put a varied lenth of spaces in if you wish.
                            If you are going to use it elsewhere, say in an excel spread sheet, then
                            it wouldn't matter.

                            You might want to check out the csv ed program that we have discussed
                            here recently. It is a great thing for working with delimited files as
                            a companion to notetab. I would have to find that link.

                            You are inserting three tabs apparently between the names.

                            I'll assume you have a list of names like this:
                            China Miéville
                            Robert J. Sawyer
                            Lois McMaster Bujold
                            Dan Simmons
                            David Brin

                            If I use your clip and highlight one name at a time, then I get your
                            result. If one name happens to be further out than the first tab stop,
                            then I get the results you get. Again the use you intend to make of
                            them matters at this point. If it is to display them in text form in
                            set columns, then you might do it something like this:
                            ; by don at htmlfixit.com
                            ; take list of names like this:
                            ;China Miéville
                            ;Robert J. Sawyer
                            ;Lois McMaster Bujold
                            ;Dan Simmons
                            ;David Brin
                            ; reorder it last, first [set width spaces] first last

                            ;go to start of file and
                            ;find the longest line
                            ;set LineLength to longest line
                            ^!Jump 1
                            ^!Set %LineLengthOriginal%=0
                            :LineLengthOriginal
                            ^!Select Eol

                            ^!If "^$StrSize("^$GetSelection$")$" <= "^%LineLengthOriginal%" SKIP_1
                            ^!Set %LineLengthOriginal%=^$StrSize("^$GetSelection$")$
                            ^!If ^$GetRow$ = ^$GetLinecount$ Process
                            ^!Jump +1
                            ; repeat for each line
                            ^!GoTo LineLengthOriginal

                            ; redo each line by placing last, first
                            ; and by padding the original so we
                            ; get uniform columns for display in text view
                            :Process
                            ^!Jump 1
                            :ReformatLines
                            ^!Select Eol
                            ^!SetCode %KeepText%=^$GetSelection$
                            ^!Replace "{.*}\s+{.*}" >> "\2, \1" RH
                            ; here is the magic line ... uniform spaces are created
                            ; by padding KeepText with spaces with right alignment
                            ; from help:
                            ; ^$StrAlign("Str";TextWidth;Alignment[;Pad=False])$ (added in v4.9)
                            ; This function aligns the Str value within a space specified by
                            TextWidth. Alignment values can be Left, Right, or Center. If the Pad
                            parameter is used, a True value adds blank spaces on the right side of
                            Str (if necessary). Examples:
                            ; ^$StrAlign("Test";10;Right)$ -> " Test"
                            ; ^$StrAlign("Test";10;Center;True)$ -> " Test "
                            ^!SetCode
                            %KeepText%=^$StrAlign("^%KeepText%";^$Calc(^%LineLengthOriginal%+15)$;Right;True)$


                            ^!InsertCode ^%KeepText%
                            ^!If ^$GetRow$ = ^$GetLinecount$ End
                            ^!Jump +1
                            ; repeat til tired or out of lines
                            ^!GoTo ReformatLines
                          • Jody
                            Hi Daniel, ... You need to use one real tab and then adjust the tab size till they line up. You need to make the tab size one character bigger than the longest
                            Message 13 of 19 , Dec 9, 2004
                            • 0 Attachment
                              Hi Daniel,

                              >It works but there is one problem. Things do not line up properly.
                              >I have tried both tab characters and spaces in the line that looks
                              >blank above but things still do not line up. Here is a sample:
                              >
                              >Miéville, China China Miéville
                              >Sawyer, Robert J. Robert J. Sawyer
                              >Bujold, Lois McMaster Lois McMaster Bujold

                              You need to use one real tab and then adjust the tab size till
                              they line up. You need to make the tab size one character bigger
                              than the longest name. Do that in Document | Properties off the
                              main menu so it is just for that document. You need to use a
                              fixed-width font like Courier New.

                              This Clip will convert the tabs to spaces aligning them, but you
                              will not be able to switch back to tabs. It will do a whole
                              document or selected lines. It will work with your 3 tabs, but
                              the spacing is a bit larger than if you were to only use 1 tab in
                              between the names. You can easily change it in the replace
                              dialog: Find "^t^t^t" Replace with "^t" w/o the quotes. (It will
                              also work with two or more spaces used as the delimiter/separator
                              instead of the tab.

                              <--- Copy below this line --->
                              H=Tabs to Spaces
                              ; 12-09-2004, ntb-clips@yahoogroups.com
                              ; http://www.notetab.net/html/snatchclp.htm, Tabs2Spaces jody

                              ; Input data must have columns separated by either a tab
                              ; character or two or more blanks. If you want to have a gap
                              ; in the table, ie an empty cell followed by non-empty
                              ; cell(s), you have to use tabs as column separators around
                              ; that cell. Regards /Claes

                              ^!ClearVariables
                              ^!Set %SelStart%=^$GetRowStart$:1; %SelEnd%=^$Calc(^$GetRowEnd$+1)$
                              ^!IfTrue ^$IsEmpty("^$GetSelection$")$ Next else Start
                              ^!Set %NoSel%=1
                              ^!Jump Doc_End
                              ^!IfFalse ^$IsEmpty(^$GetLine$)$ Skip_2
                              ^!Replace "^p" >> "" SB
                              ^!IfError Next else Skip_-2
                              ^!InsertText ^p
                              ^!Jump 1

                              :Start
                              ^!SetHintInfo Working...
                              ^!SetScreenUpdate Off
                              ^!SetWordWrap OFF

                              ;Make all delimiters tabs
                              ^!IfTrue ^%NoSel% Next else Skip_2
                              ^!Replace "[ ][ ]+" >> "\t" STAIRWH
                              ^!Goto Skip
                              ^!Replace "[ ][ ]+" >> "\t" STAIRH
                              ^!SetListDelimiter ^t
                              ^!SetArray %oldsz%=0
                              ; ^!Jump TEXT_START
                              ^!SetCursor ^%SelStart%

                              ;FIND THE REQUIRED COLUMN SIZES
                              ;Get a line as an array
                              :nextrec
                              ^!Select EOL
                              ^!Set %a%=^$GetSelection$
                              ^!SetArray %new%=^%a%
                              ^!SetArray %newsz%=^%new%

                              ;Make array of field sizes
                              ^!Set %ix%=0
                              ^!Inc %ix%
                              ^!Set %newsz^%ix%%=^$StrSize("^%new^%ix%%")$
                              ^!If ^%ix%<^%new0% Skip_-2

                              ;Merge new and old array
                              ^!SetArray %long%=^%oldsz%
                              ^!SetArray %short%=^%newsz%
                              ^!If ^%oldsz0%>^%newsz0% mergethem
                              ^!SetArray %long%=^%newsz%
                              ^!SetArray %short%=^%oldsz%
                              :mergethem
                              ^!Set %ix%=0
                              ^!Inc %ix%
                              ^!Set %long^%ix%%=^$calc(max(^%oldsz^%ix%%;^%newsz^%ix%%))$
                              ^!If ^%ix%<^%short0% Skip_-2
                              ^!SetArray %oldsz%=^%long%
                              ^!If ^$GetRow$=^$GetLineCount$ InsertSpace

                              ;Get next line
                              ^!Jump +1
                              ^!Jump LINE_START
                              ^!GoTo nextrec

                              ;NOW INSERT SPACES
                              :InsertSpace
                              ; ^!Jump TEXT_START
                              ^!SetCursor ^%SelStart%

                              ;Again pick up a line as an array
                              :nextrec2
                              ^!Select EOL
                              ^!Set %a%=^$getselection$
                              ^!Setarray %new%=^%a%
                              ;Skip record if only one field
                              ^!If ^%new0%<2 nextline
                              ^!Setarray %newsz%=^%new%

                              ;Make array of field sizes
                              ^!Set %ix%=0
                              ^!Inc %ix%
                              ^!Set %newsz^%ix%%=^$StrSize("^%new^%ix%%")$
                              ^!If ^%ix%<^%new0% Skip_-2

                              ;Get nbr of blanks needed and insert them
                              ^!Set %ix%=1
                              ^!Jump LINE_START
                              :nextfld2
                              ^!Find "^t" TIS
                              ^!InsertText ^$StrFill(" ";^$Calc(^%oldsz^%ix%%-^%newsz^%ix%%+2)$)$
                              ^!Inc %ix%
                              ^!If ^%ix%<^%newsz0% nextfld2
                              ^!If ^$GetRow$=^$GetLineCount$ Exit

                              ;Get next line
                              :nextline
                              ^!Jump +1
                              ^!Jump LINE_START
                              ^!IfTrue ^%NoSel% Next else Skip_2
                              ^!If ^$GetRow$ = ^$GetLineCount$ End
                              ^!Goto nextrec2
                              ^!If ^$GetRow$ = ^%SelEnd% End
                              ^!Goto nextrec2

                              <--- Copy above this line --->
                              <--- Right click over a Library --->
                              <--- Choose: Add from Clipboard --->


                              Happy Clip'n!
                              Jody

                              www.clean-funnies.com, http://www.fookes.us/maillist.htm

                              Subscribe: mailto:ntb-Clips-Subscribe@yahoogroups.com
                              UnSubscribe: mailto:ntb-Clips-UnSubscribe@yahoogroups.com
                              Options: http://groups.yahoo.com/group/ntb-clips
                            • Daniel Prince
                              On Thu, 09 Dec 2004 10:46:25 -0500, Don - htmlfixit.com ... Vinge, Vernor Vernor Vinge Turtledove, Harry Harry
                              Message 14 of 19 , Dec 10, 2004
                              • 0 Attachment
                                On Thu, 09 Dec 2004 10:46:25 -0500, "Don - htmlfixit.com"
                                <don@...> wrote:

                                >
                                >I guess the question is what exactly are you trying to do?
                                >Give us 15 lines of the input and 15 lines of the desired output.

                                Vinge, Vernor Vernor Vinge
                                Turtledove, Harry Harry Turtledove
                                Duane, Diane Diane Duane
                                Cassutt, Michael Michael Cassutt
                                Hamilton, Peter Peter Hamilton
                                Haldeman, Joe Joe Haldeman
                                Landis, Geoff Geoff Landis
                                Baxter, Steven Steven Baxter
                                Sawyer, Robert J. Robert J. Sawyer
                                Herbert, Brian Brian Herbert
                                Simmons, Dan Dan Simmons
                                Hendrix, Howard Howard Hendrix
                                Brin, David David Brin
                                Pratchett, Terry Terry Pratchett
                                Bujold, Lois Mcmaster Lois Mcmaster Bujold

                                >Is this a list of only names? If so why highlight anything.

                                I want to highlight the names because I have a list that I
                                periodically add to. I do not want the names that have already been
                                converted to be converted again. Also I put some book names into
                                the list. If I run your clip again I get this:


                                vinge , vinge, vernor vernor
                                vinge, vernor vernor vinge
                                Turtledove , Turtledove, Harry Harry
                                Turtledove, Harry Harry Turtledove
                                etc.

                                Can I limit your script to just selected text, perhaps with
                                ^$GetSelection$?
                                --
                                I am TERRIBLY cruel to my cat. I tease him with a vine tendril
                                until he either jumps up in the air to bat at it or zooms around
                                in a circle until he gets too dizzy to stand up. What is cruel about
                                it is that I don't do it nearly as much as he wants me to.
                              • Daniel Prince
                                ... This clip works but it does not stop by itself. Could I have done something wrong when I installed it? -- I am TERRIBLY cruel to my cat. I tease him with
                                Message 15 of 19 , Dec 15, 2004
                                • 0 Attachment
                                  On Thu, 09 Dec 2004 12:17:01 -0600, you wrote:

                                  >This Clip will convert the tabs to spaces aligning them, but you
                                  >will not be able to switch back to tabs. It will do a whole
                                  >document or selected lines. It will work with your 3 tabs, but
                                  >the spacing is a bit larger than if you were to only use 1 tab in
                                  >between the names. You can easily change it in the replace
                                  >dialog: Find "^t^t^t" Replace with "^t" w/o the quotes. (It will
                                  >also work with two or more spaces used as the delimiter/separator
                                  >instead of the tab.
                                  >
                                  ><--- Copy below this line --->
                                  >H=Tabs to Spaces
                                  >; 12-09-2004, ntb-clips@yahoogroups.com
                                  >; http://www.notetab.net/html/snatchclp.htm, Tabs2Spaces jody
                                  >
                                  >; Input data must have columns separated by either a tab
                                  >; character or two or more blanks. If you want to have a gap
                                  >; in the table, ie an empty cell followed by non-empty
                                  >; cell(s), you have to use tabs as column separators around
                                  >; that cell. Regards /Claes
                                  >
                                  >^!ClearVariables
                                  >^!Set %SelStart%=^$GetRowStart$:1; %SelEnd%=^$Calc(^$GetRowEnd$+1)$
                                  >^!IfTrue ^$IsEmpty("^$GetSelection$")$ Next else Start
                                  >^!Set %NoSel%=1
                                  >^!Jump Doc_End
                                  >^!IfFalse ^$IsEmpty(^$GetLine$)$ Skip_2
                                  >^!Replace "^p" >> "" SB
                                  >^!IfError Next else Skip_-2
                                  >^!InsertText ^p
                                  >^!Jump 1
                                  >
                                  >:Start
                                  >^!SetHintInfo Working...
                                  >^!SetScreenUpdate Off
                                  >^!SetWordWrap OFF
                                  >
                                  >;Make all delimiters tabs
                                  >^!IfTrue ^%NoSel% Next else Skip_2
                                  >^!Replace "[ ][ ]+" >> "\t" STAIRWH
                                  >^!Goto Skip
                                  >^!Replace "[ ][ ]+" >> "\t" STAIRH
                                  >^!SetListDelimiter ^t
                                  >^!SetArray %oldsz%=0
                                  >; ^!Jump TEXT_START
                                  >^!SetCursor ^%SelStart%
                                  >
                                  >;FIND THE REQUIRED COLUMN SIZES
                                  >;Get a line as an array
                                  >:nextrec
                                  >^!Select EOL
                                  >^!Set %a%=^$GetSelection$
                                  >^!SetArray %new%=^%a%
                                  >^!SetArray %newsz%=^%new%
                                  >
                                  >;Make array of field sizes
                                  >^!Set %ix%=0
                                  >^!Inc %ix%
                                  >^!Set %newsz^%ix%%=^$StrSize("^%new^%ix%%")$
                                  >^!If ^%ix%<^%new0% Skip_-2
                                  >
                                  >;Merge new and old array
                                  >^!SetArray %long%=^%oldsz%
                                  >^!SetArray %short%=^%newsz%
                                  >^!If ^%oldsz0%>^%newsz0% mergethem
                                  >^!SetArray %long%=^%newsz%
                                  >^!SetArray %short%=^%oldsz%
                                  >:mergethem
                                  >^!Set %ix%=0
                                  >^!Inc %ix%
                                  >^!Set %long^%ix%%=^$calc(max(^%oldsz^%ix%%;^%newsz^%ix%%))$
                                  >^!If ^%ix%<^%short0% Skip_-2
                                  >^!SetArray %oldsz%=^%long%
                                  >^!If ^$GetRow$=^$GetLineCount$ InsertSpace
                                  >
                                  >;Get next line
                                  >^!Jump +1
                                  >^!Jump LINE_START
                                  >^!GoTo nextrec
                                  >
                                  >;NOW INSERT SPACES
                                  >:InsertSpace
                                  >; ^!Jump TEXT_START
                                  >^!SetCursor ^%SelStart%
                                  >
                                  >;Again pick up a line as an array
                                  >:nextrec2
                                  >^!Select EOL
                                  >^!Set %a%=^$getselection$
                                  >^!Setarray %new%=^%a%
                                  >;Skip record if only one field
                                  >^!If ^%new0%<2 nextline
                                  >^!Setarray %newsz%=^%new%
                                  >
                                  >;Make array of field sizes
                                  >^!Set %ix%=0
                                  >^!Inc %ix%
                                  >^!Set %newsz^%ix%%=^$StrSize("^%new^%ix%%")$
                                  >^!If ^%ix%<^%new0% Skip_-2
                                  >
                                  >;Get nbr of blanks needed and insert them
                                  >^!Set %ix%=1
                                  >^!Jump LINE_START
                                  >:nextfld2
                                  >^!Find "^t" TIS
                                  >^!InsertText ^$StrFill(" ";^$Calc(^%oldsz^%ix%%-^%newsz^%ix%%+2)$)$
                                  >^!Inc %ix%
                                  >^!If ^%ix%<^%newsz0% nextfld2
                                  >^!If ^$GetRow$=^$GetLineCount$ Exit
                                  >
                                  >;Get next line
                                  >:nextline
                                  >^!Jump +1
                                  >^!Jump LINE_START
                                  >^!IfTrue ^%NoSel% Next else Skip_2
                                  >^!If ^$GetRow$ = ^$GetLineCount$ End
                                  >^!Goto nextrec2
                                  >^!If ^$GetRow$ = ^%SelEnd% End
                                  >^!Goto nextrec2

                                  This clip works but it does not stop by itself. Could I have done
                                  something wrong when I installed it?

                                  --
                                  I am TERRIBLY cruel to my cat. I tease him with a vine tendril
                                  until he either jumps up in the air to bat at it or zooms around
                                  in a circle until he gets too dizzy to stand up. What is cruel about
                                  it is that I don't do it nearly as much as he wants me to.
                                • Jody
                                  Hi Daniel, ... I ll have to look into it later. When you reply to posts, please delete parts of the message that are not needed to understand your reply.
                                  Message 16 of 19 , Dec 15, 2004
                                  • 0 Attachment
                                    Hi Daniel,

                                    >>This Clip will convert the tabs to spaces aligning them, but you
                                    >>will not be able to switch back to tabs.
                                    >>
                                    >><--- Copy below this line --->
                                    >>H=Tabs to Spaces
                                    >>; 12-09-2004, ntb-clips@yahoogroups.com
                                    >>; http://www.notetab.net/html/snatchclp.htm, Tabs2Spaces jody
                                    >
                                    >This clip works but it does not stop by itself. Could I have done
                                    >something wrong when I installed it?

                                    I'll have to look into it later. When you reply to posts, please
                                    delete parts of the message that are not needed to understand
                                    your reply. Thanks!!! Try changing your three tabs to one tab to
                                    see if that makes a difference. Also, have one blank line at the
                                    end of your list in case the code is not doing that that I added
                                    and that is the problem. Are you doing it on a selection or on
                                    the whole document?

                                    Happy Clip'n!
                                    Jody

                                    www.clean-funnies.com, http://www.fookes.us/maillist.htm

                                    Subscribe: mailto:ntb-Clips-Subscribe@yahoogroups.com
                                    UnSubscribe: mailto:ntb-Clips-UnSubscribe@yahoogroups.com
                                    Options: http://groups.yahoo.com/group/ntb-clips
                                  • Daniel Prince
                                    On Wed, 15 Dec 2004 11:55:14 -0600, Jody ... It stops by itself if I have it do the whole document but not if there is text
                                    Message 17 of 19 , Dec 15, 2004
                                    • 0 Attachment
                                      On Wed, 15 Dec 2004 11:55:14 -0600, Jody <kjv-av1611@...>
                                      wrote:

                                      >Try changing your three tabs to one tab to
                                      >see if that makes a difference. Also, have one blank line at the
                                      >end of your list in case the code is not doing that that I added
                                      >and that is the problem. Are you doing it on a selection or on
                                      >the whole document?

                                      It stops by itself if I have it do the whole document but not if
                                      there is text selected. It does not matter if there are three tabs
                                      or one or if there are blank lines selected after the text. It just
                                      keeps going with the CPU usage at 100 percent until I hit Alt &
                                      Control.
                                      --
                                      I am TERRIBLY cruel to my cat. I tease him with a vine tendril
                                      until he either jumps up in the air to bat at it or zooms around
                                      in a circle until he gets too dizzy to stand up. What is cruel about
                                      it is that I don't do it nearly as much as he wants me to.
                                    • Jody
                                      Hi Daniel, ... Do you have the problem with the following text? Are you in NoteTab Pro? I tried it in both NoteTab Pro and NoteTab Standard/Light and cannot
                                      Message 18 of 19 , Dec 16, 2004
                                      • 0 Attachment
                                        Hi Daniel,

                                        >> Try changing your three tabs to one tab to see if that makes a
                                        >> difference. Also, have one blank line at the end of your list
                                        >> in case the code is not doing that that I added and that is the
                                        >> problem. Are you doing it on a selection or on the whole
                                        >> document?
                                        >
                                        >It stops by itself if I have it do the whole document but not if
                                        >there is text selected. It does not matter if there are three
                                        >tabs or one or if there are blank lines selected after the text.
                                        >It just keeps going with the CPU usage at 100 percent until I hit
                                        >Alt & Control.

                                        Do you have the problem with the following text? Are you in
                                        NoteTab Pro? I tried it in both NoteTab Pro and NoteTab
                                        Standard/Light and cannot get it to fail. (Make sure the tabs
                                        aren't converted in the mail.)

                                        Miéville, China China Miéville
                                        Sawyer, Robert J. Robert J. Sawyer
                                        Bujold, Lois McMaster Lois McMaster Bujold
                                        Simmons, Dan Dan Simmons
                                        Brin, David David Brin


                                        Happy Clip'n!
                                        Jody

                                        www.clean-funnies.com, http://www.fookes.us/maillist.htm

                                        Subscribe: mailto:ntb-Clips-Subscribe@yahoogroups.com
                                        UnSubscribe: mailto:ntb-Clips-UnSubscribe@yahoogroups.com
                                        Options: http://groups.yahoo.com/group/ntb-clips
                                      • Daniel Prince
                                        On Thu, 16 Dec 2004 05:55:10 -0600, Jody ... Yes and the first line was not converted, perhaps because that tab was converted in the
                                        Message 19 of 19 , Dec 16, 2004
                                        • 0 Attachment
                                          On Thu, 16 Dec 2004 05:55:10 -0600, Jody <kjv-av1611@...>
                                          wrote:

                                          >Do you have the problem with the following text?

                                          Yes and the first line was not converted, perhaps because that tab
                                          was converted in the mail.


                                          >Are you in NoteTab Pro?

                                          I use Standard 4.95/np under Windows XP 5.1.
                                          --
                                          I am TERRIBLY cruel to my cat. I tease him with a vine tendril
                                          until he either jumps up in the air to bat at it or zooms around
                                          in a circle until he gets too dizzy to stand up. What is cruel about
                                          it is that I don't do it nearly as much as he wants me to.
                                        Your message has been successfully submitted and would be delivered to recipients shortly.