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

[NTB] Re: Indenting, Unindenting, Line by Line

Expand Messages
  • Roger Williams
    ... Ah, that will be a problem. I get press releases from all over the US and sometimes from Europe, too, and have to reformat them for distribution here in
    Message 1 of 21 , Feb 23, 1999
    • 0 Attachment
      Larry Thomas wrote:

      > This demonstrates how you can get carried away with all of the bells and
      > whistles in NoteTab's clip sysnax. I wrote this clip:
      >
      > ---------< start clip >---------
      > H="Indent Line by Line"
      > ^!CLEARVARIABLES
      > ^!IFTRUE (^$IsWordWrap$) SKIP_2 ELSE NEXT
      > ^!TOOLBAR TOGGLE WORD WRAP
      > ^!SET %WW%=ON
      > ^!SET %INDENT%=^?{INDENT=}
      > ^!TOOLBAR SELECT ALL
      > ^!TOOLBAR LEFT ALIGN
      > ^!KEYBOARD ^$StrFill("CTRL+I ";^%INDENT)$
      > ^!JUMP DOC_START
      > ^!IF ^%WW% = ON NEXT ELSE EXIT
      > ^!TOOLBAR TOGGLE WORD WRAP
      > ---------< end clip >-----------
      >
      > It works ---- BUT --- I trimmed it down to:
      >
      > ---------< start clip >---------
      > H="Indent Line by LIne"
      > ^!SET %INDENT%=^?{INDENT=}
      > ^!TOOLBAR SELECT ALL
      > ^!TOOLBAR LEFT ALIGN
      > ^!KEYBOARD ^$StrFill("CTRL+I ";^%INDENT)$
      > ^!JUMP DOC_sTART
      > ---------< end clip >-----------
      >
      > And it still works!! All of the business with toggling word wrap off and
      > back on is wasted time and code space which also means that it is still
      > faster (some).
      >
      > Yes, Roger. This clip does what you described to me. It indents the first
      > line of the paragraph only - provided your paragraph contains cr/lf's at
      > its end only.

      Ah, that will be a problem. I get press releases from all over
      the US and sometimes from Europe, too, and have to reformat them
      for distribution here in Asia. Some of them only have cr/lf at
      paragraph ends, and some (always those with tabular material like
      statements of profit and loss) have a cr/lf at the end of every
      line. That's not including the minority who send me files with
      ONLY crs or ONLY lfs (if I am remembering it right--oddball,
      anyway. I seem to remember it has something to do with using MACs
      or UNIX machines. I play around with the NoteTab Pro line-end
      settings, not really knowing what I'm doing, until I find one
      that works). When the releases go out from here, they definitely
      must have a cr/lf pair at the end of every single line. This is
      required by the fax software I am using for media that either
      don't have E-mail addresses or are coy about giving them out. So
      if they didn't have cr/lf pairs to start with, I have to make
      sure they get put in.

      So what I probably need is a line-by-line that looks for an
      indent, passes by doing nothing if there ISN'T one, and adjusts
      it to (say) "5" for those that do. I would need to be able to
      SELECT the region of text to apply this to, which would enable me
      to bypass the rigidly formatted tables, which mustn't be touched.

      You're all probably sick and tired of helping out with such a
      minor (dare I say almost "trivial" to the experts) problem, so
      just a pointer to the kinds of things I should be looking
      at/using in my clip would be great.

      Roger

      ------------------------------------------------------------------------
      eGroup home: http://www.eGroups.com/list/notetab
      Free Web-based e-mail groups by eGroups.com
    • Larry Thomas
      Hi Roger, ... H= Indent Line by Line ^!TOOLBAR SELECT ALL ^!TOOLBAR LEFT ALIGN ^!KEYBOARD ^$StrFill( CTRL+I ;5)$ ^!JUMP DOC_START ... This clip removes all
      Message 2 of 21 , Feb 23, 1999
      • 0 Attachment
        Hi Roger,

        At 01:11 PM 2/24/1999 +0900, you wrote:
        >Larry Thomas wrote:
        >
        >> ---------< start clip >---------
        >> H="Indent Line by LIne"
        >> ^!SET %INDENT%=^?{INDENT=}
        >> ^!TOOLBAR SELECT ALL
        >> ^!TOOLBAR LEFT ALIGN
        >> ^!KEYBOARD ^$StrFill("CTRL+I ";^%INDENT)$
        >> ^!JUMP DOC_sTART
        >> ---------< end clip >-----------
        >>

        Modify this clip to:

        ---------< start clip >---------
        H="Indent Line by Line"
        ^!TOOLBAR SELECT ALL
        ^!TOOLBAR LEFT ALIGN
        ^!KEYBOARD ^$StrFill("CTRL+I ";5)$
        ^!JUMP DOC_START
        ---------< end clip >-----------

        This clip removes all indents from selected text and then reindents it 5
        spaces. You will still get an indent after every cr/lf in your selected
        text and your indent will always be 5 (assuming you have the default set to
        one space) but this will not select anything. You have to select what you
        want before you use it and it will work only on your selection so you
        should not have a problem with single lines that should not be indented
        unless you accidentally indent them. If you do, just reselect those lines
        only and select Modify | Alignment | Left Align from the menu to remove all
        indents in your selection.

        If you wanted to do a lot of this it is possible to put the following
        buttons on your tool bar - Left Align, Increase Indent, Decrease Indent,
        Reformat Lines. Then you would just select the text you want and reformat
        it. You might discover that you do not need clips for most of what you do
        at all.

        >
        >Ah, that will be a problem. I get press releases from all over
        >the US and sometimes from Europe, too, and have to reformat them
        >for distribution here in Asia. Some of them only have cr/lf at
        >paragraph ends, and some (always those with tabular material like
        >statements of profit and loss) have a cr/lf at the end of every
        >line. That's not including the minority who send me files with
        >ONLY crs or ONLY lfs (if I am remembering it right--oddball,
        >anyway. I seem to remember it has something to do with using MACs
        >or UNIX machines. I play around with the NoteTab Pro line-end
        >settings, not really knowing what I'm doing, until I find one
        >that works). When the releases go out from here, they definitely
        >must have a cr/lf pair at the end of every single line. This is
        >required by the fax software I am using for media that either
        >don't have E-mail addresses or are coy about giving them out. So
        >if they didn't have cr/lf pairs to start with, I have to make
        >sure they get put in.
        >

        I am not sure how to get into this. If I think of something, I will post it.

        >So what I probably need is a line-by-line that looks for an
        >indent, passes by doing nothing if there ISN'T one, and adjusts
        >it to (say) "5" for those that do. I would need to be able to
        >SELECT the region of text to apply this to, which would enable me
        >to bypass the rigidly formatted tables, which mustn't be touched.
        >
        >You're all probably sick and tired of helping out with such a
        >minor (dare I say almost "trivial" to the experts) problem, so
        >just a pointer to the kinds of things I should be looking
        >at/using in my clip would be great.

        I get "tired" when I am trying things and nothing seems to work. But then
        I take off for an hour or two or a day or two and do something else and see
        what if anything someone else is posting and when I come back later my mind
        frequently seems to come up with ideas for solving a problem. Even if I am
        not consciously thinking about it. I would also think/hope that some of
        this would be helpful to you in writing your own clips providing ideas for
        solutions.


        Regards,

        Larry Thomas
        larryt@...

        ------------------------------------------------------------------------
        eGroup home: http://www.eGroups.com/list/notetab
        Free Web-based e-mail groups by eGroups.com
      • Roger Williams
        ... Yes, if I am going through the release reformatting it, it s no biggier whether I click on clips or on things moved to the toolbar. The ideal will be a
        Message 3 of 21 , Feb 23, 1999
        • 0 Attachment
          Larry Thomas wrote:
          > Modify this clip to:
          >
          > ---------< start clip >---------
          > H="Indent Line by Line"
          > ^!TOOLBAR SELECT ALL
          > ^!TOOLBAR LEFT ALIGN
          > ^!KEYBOARD ^$StrFill("CTRL+I ";5)$
          > ^!JUMP DOC_START
          > ---------< end clip >-----------
          >
          > This clip removes all indents from selected text and then reindents it 5
          > spaces. You will still get an indent after every cr/lf in your selected
          > text and your indent will always be 5 (assuming you have the default set to
          > one space) but this will not select anything. You have to select what you
          > want before you use it and it will work only on your selection so you
          > should not have a problem with single lines that should not be indented
          > unless you accidentally indent them. If you do, just reselect those lines
          > only and select Modify | Alignment | Left Align from the menu to remove all
          > indents in your selection.
          >
          > If you wanted to do a lot of this it is possible to put the following
          > buttons on your tool bar - Left Align, Increase Indent, Decrease Indent,
          > Reformat Lines. Then you would just select the text you want and reformat
          > it. You might discover that you do not need clips for most of what you do
          > at all.

          Yes, if I am going through the release reformatting it, it's no
          biggier whether I click on clips or on things moved to the
          toolbar. The ideal will be a script that goes down line by line
          and does everything I need for the whole area selected. I can't
          see any way of getting around selections, although tabular
          material is ALWAYS identified by a small "slug" just before and
          after the table, and I guess I could select or protect the text
          between those two slugs to prevent the tables getting mangled.

          > >Ah, that will be a problem. I get press releases from all over
          > >the US and sometimes from Europe, too, and have to reformat them
          > >for distribution here in Asia. Some of them only have cr/lf at
          > >paragraph ends, and some (always those with tabular material like
          > >statements of profit and loss) have a cr/lf at the end of every
          > >line. That's not including the minority who send me files with
          > >ONLY crs or ONLY lfs (if I am remembering it right--oddball,
          > >anyway. I seem to remember it has something to do with using MACs
          > >or UNIX machines. I play around with the NoteTab Pro line-end
          > >settings, not really knowing what I'm doing, until I find one
          > >that works). When the releases go out from here, they definitely
          > >must have a cr/lf pair at the end of every single line. This is
          > >required by the fax software I am using for media that either
          > >don't have E-mail addresses or are coy about giving them out. So
          > >if they didn't have cr/lf pairs to start with, I have to make
          > >sure they get put in.
          > >
          >
          > I am not sure how to get into this. If I think of something, I will post it.

          All suggestions gratefully received. The difference between cr-lf
          at every line and only at the end of each paragraph is the
          critical one. The non-standard files are so rare that I can
          afford to hand-massage them.

          > >So what I probably need is a line-by-line that looks for an
          > >indent, passes by doing nothing if there ISN'T one, and adjusts
          > >it to (say) "5" for those that do. I would need to be able to
          > >SELECT the region of text to apply this to, which would enable me
          > >to bypass the rigidly formatted tables, which mustn't be touched.

          > I get "tired" when I am trying things and nothing seems to work. But then
          > I take off for an hour or two or a day or two and do something else and see
          > what if anything someone else is posting and when I come back later my mind
          > frequently seems to come up with ideas for solving a problem. Even if I am
          > not consciously thinking about it. I would also think/hope that some of
          > this would be helpful to you in writing your own clips providing ideas for
          > solutions.

          Yes indeed. I am recalling the time, about 20 years ago, when I
          got into BASIC programming and did some nifty little
          text-manipulating programs for our typesetting section. It was a
          lot of fun. I was using a 1.7MHz CPU from Tandy Radio Shack and
          today's 450MHz Pentium II screamers would have sounded like
          something from outer space.

          Thanks for the suggestions.

          Roger

          ------------------------------------------------------------------------
          eGroup home: http://www.eGroups.com/list/notetab
          Free Web-based e-mail groups by eGroups.com
        • Jody
          Hi Roger, ... This first one will only do lines that have three spaces after a hard break leaving all other lines untouched. You can adjust the three spaces
          Message 4 of 21 , Feb 24, 1999
          • 0 Attachment
            Hi Roger,

            >So what I probably need is a line-by-line that looks for an
            >indent, passes by doing nothing if there ISN'T one, and adjusts
            >it to (say) "5" for those that do. I would need to be able to
            >SELECT the region of text to apply this to, which would enable me
            >to bypass the rigidly formatted tables, which mustn't be touched.

            This first one will only do lines that have three spaces after a
            hard break leaving all other lines untouched. You can adjust the
            three spaces right after :Loop2 in the ^!Find. The five space
            indent can be adjusted in the ^$StrReplace...$ right above ^!Goto
            Loop2.

            I can't think of how to do a selected area, but I can stop it at a
            given line number. The way it is set is if you give it #45 for the
            prompt question it will include line 45 in it. Use 44 if you do
            not want 45 done. :-) Place your cursor where you want it to start
            from at least one line up from the first indent. (It needs to see
            the first hard break.)

            To use that latter method take out the semi-colon on these two lines:

            ;^!Set %Stop%=^?{Line number to stop at=}
            ;^!If "^$GetRow$" => "^%Stop%" End Else Loop1

            H=AdjusttoFive
            ^!SetHintInfo Adjusting Indents...
            ^!SetScreenUpDate Off
            ^!Set %Index%=2; %Amount%=1
            ;^!Set %Stop%=^?{Line number to stop at=}

            :Loop1
            ^!Find "^p " S
            ^!IfError End
            ^!Jump Select_End

            :Loop2
            ^!Select +1
            ^!IfSame " " "^$StrCopy("^$GetSelection$";1;1)$" Next else Reformat
            ^!Jump Select_End
            ^!Goto Loop2

            :Reformat
            ^!Jump Select_Start
            ^!Select Bol
            ^$StrReplace("^$GetSelection$";" ";"^$GetSelection$";True;False)$
            ;^!If "^$GetRow$" => "^%Stop%" End Else Loop1
            ^!Goto Loop1

            Happy NoteTabbin',
            Jody Adair

            The NoteTabbers' Assistant Page
            http://www.mindspring.com/~kjb1611/notetab/

            ------------------------------------------------------------------------
            eGroup home: http://www.eGroups.com/list/notetab
            Free Web-based e-mail groups by eGroups.com
          • Larry Thomas
            Hi Roger, ... You might write a clip that shuts off word wrap and uses line size to identify the lines you do not want to process. The ^$GetLineSize$ function
            Message 5 of 21 , Feb 24, 1999
            • 0 Attachment
              Hi Roger,

              At 04:55 PM 2/24/1999 +0900, you wrote:
              >Larry Thomas wrote:
              >
              >All suggestions gratefully received. The difference between cr-lf
              >at every line and only at the end of each paragraph is the
              >critical one. The non-standard files are so rare that I can
              >afford to hand-massage them.
              >
              >> >So what I probably need is a line-by-line that looks for an
              >> >indent, passes by doing nothing if there ISN'T one, and adjusts
              >> >it to (say) "5" for those that do. I would need to be able to
              >> >SELECT the region of text to apply this to, which would enable me
              >> >to bypass the rigidly formatted tables, which mustn't be touched.
              >

              You might write a clip that shuts off word wrap and uses line size to
              identify the lines you do not want to process. The ^$GetLineSize$ function
              could be used with the ^!If command to cause the clip to skip processing on
              all lines that are less than 81 characters long. Of coarse, you always
              must consider that some short lines will not be part of a table but then
              again you may not want to indent any short lines at all.

              Regards,

              Larry Thomas
              larryt@...

              ------------------------------------------------------------------------
              eGroup home: http://www.eGroups.com/list/notetab
              Free Web-based e-mail groups by eGroups.com
            • Jody
              Hi Roger and Larry, ... I need to correct that. It should have read three OR MORE spaces. Anyhow, roger, if I am reading your post right the clip(s) I sent
              Message 6 of 21 , Feb 24, 1999
              • 0 Attachment
                Hi Roger and Larry,

                >>So what I probably need is a line-by-line that looks for an
                >This first one will only do lines that have three spaces after a
                >hard break leaving all other lines untouched.

                I need to correct that. It should have read three OR MORE spaces.
                Anyhow, roger, if I am reading your post right the clip(s) I sent
                should do it for you, the latter of the two more of what you asked
                for, but my guss is the first would work as well.

                Happy NoteTabbin',
                Jody Adair

                The NoteTabbers' Assistant Page
                http://www.mindspring.com/~kjb1611/notetab/

                ------------------------------------------------------------------------
                eGroup home: http://www.eGroups.com/list/notetab
                Free Web-based e-mail groups by eGroups.com
              • Kay Roath
                2/24/1999 1:55 AM Roger Williams wrote If I understand this thread, you want a clip that will indent every line that starts with a space by a specified amount?
                Message 7 of 21 , Feb 24, 1999
                • 0 Attachment
                  2/24/1999 1:55 AM Roger Williams wrote

                  If I understand this thread, you want a clip that will
                  indent every line that starts with a space by a specified
                  amount? The 5 in the %fill% line is the # of spaces.

                  H=IndentTest
                  ^!SetWordWrap OFF
                  ^!Set %line%=1
                  ^!Set %fill%=^$StrFill( ;5)$

                  :Process
                  ^!Jump ^%line%
                  ^!Select LINE
                  ; long line
                  ^!If ^$StrPos("^%space%";"^$GetSelection$";False)$=1 Fix ELSE Next
                  ; end of long line

                  :Fix
                  ; long line
                  ^!Set %var%=^$StrInsert("^%fill%";"^$StrTrim(^$GetSelection$)$";1)$
                  ; end of long line

                  ^!InsertText ^%var%^p
                  ^!Goto Next

                  :Next
                  ^!Inc %line%
                  ^!If ^%line% > ^$GetLineCount$ End
                  ^!Goto Process


                  --- Grandma Kay ---
                  Introduction to NoteTab Clip Programming
                  http://notetab.kay.net



                  ------------------------------------------------------------------------
                  eGroup home: http://www.eGroups.com/list/notetab
                  Free Web-based e-mail groups by eGroups.com
                • David Seidman
                  ... Just to keep things in perspective, Wayne s NoteAwk makes it very easy to run a gawk script on your NoteTab documents. Here is a script that will replace
                  Message 8 of 21 , Feb 24, 1999
                  • 0 Attachment
                    At 05:37 PM 2/24/1999 -0600, Kay Roath wrote:
                    >2/24/1999 1:55 AM Roger Williams wrote
                    >
                    >If I understand this thread, you want a clip that will
                    >indent every line that starts with a space by a specified
                    >amount? The 5 in the %fill% line is the # of spaces.
                    >
                    >H=IndentTest
                    >^!SetWordWrap OFF
                    >^!Set %line%=1
                    >^!Set %fill%=^$StrFill( ;5)$
                    >
                    >:Process
                    >^!Jump ^%line%
                    >^!Select LINE
                    >; long line
                    >^!If ^$StrPos("^%space%";"^$GetSelection$";False)$=1 Fix ELSE Next
                    >; end of long line
                    >
                    >:Fix
                    >; long line
                    >^!Set %var%=^$StrInsert("^%fill%";"^$StrTrim(^$GetSelection$)$";1)$
                    >; end of long line
                    >
                    >^!InsertText ^%var%^p
                    >^!Goto Next
                    >
                    >:Next
                    >^!Inc %line%
                    >^!If ^%line% > ^$GetLineCount$ End
                    >^!Goto Process

                    Just to keep things in perspective, Wayne's NoteAwk makes it very easy to
                    run a gawk script on your NoteTab documents. Here is a script that will
                    replace an initial one or more spaces (on each line that begins that way)
                    with five spaces:

                    {sub(/^ +/," ")
                    print}


                    (That may not be a very efficient way to write it, though.) If you want to
                    replace only the first space by five spaces, delete the + in the script.
                    Used with Wayne's clip, it works on the whole document if you do not select
                    text; otherwise, it works on the selected text.


                    ------------------------------------------------------------------------
                    eGroup home: http://www.eGroups.com/list/notetab
                    Free Web-based e-mail groups by eGroups.com
                  • Roger Williams
                    ... Thanks, Jody. Much appreciated... Roger ... eGroup home: http://www.eGroups.com/list/notetab Free Web-based e-mail groups by eGroups.com
                    Message 9 of 21 , Feb 25, 1999
                    • 0 Attachment
                      Jody wrote:

                      > >So what I probably need is a line-by-line that looks for an
                      > >indent, passes by doing nothing if there ISN'T one, and adjusts
                      > >it to (say) "5" for those that do.

                      > This first one will only do lines that have three spaces after a
                      > hard break leaving all other lines untouched. You can adjust the
                      > three spaces right after :Loop2 in the ^!Find. The five space
                      > indent can be adjusted in the ^$StrReplace...$ right above ^!Goto
                      > Loop2.

                      Thanks, Jody. Much appreciated...

                      Roger

                      ------------------------------------------------------------------------
                      eGroup home: http://www.eGroups.com/list/notetab
                      Free Web-based e-mail groups by eGroups.com
                    • Roger Williams
                      ... There is no reliable association between lengths of line and need to indent (or avoid indenting) and certainly none with whether or not the material
                      Message 10 of 21 , Feb 25, 1999
                      • 0 Attachment
                        Larry Thomas wrote:

                        > You might write a clip that shuts off word wrap and uses line size to
                        > identify the lines you do not want to process. The ^$GetLineSize$ function
                        > could be used with the ^!If command to cause the clip to skip processing on
                        > all lines that are less than 81 characters long. Of coarse, you always
                        > must consider that some short lines will not be part of a table but then
                        > again you may not want to indent any short lines at all.

                        There is no reliable association between lengths of line and need
                        to indent (or avoid indenting) and certainly none with whether or
                        not the material consists of a table, so I think I'll make use of
                        the "slugs" (special codes) that are usually used to identify
                        tabular material. Just before and after a table I usually see the
                        following sequence: (*T), which obviously means "Watch out for
                        Table" or something similar.

                        Roger

                        ------------------------------------------------------------------------
                        eGroup home: http://www.eGroups.com/list/notetab
                        Free Web-based e-mail groups by eGroups.com
                      • Roger Williams
                        ... Yes, I think that will do it. Thanks! Roger ... eGroup home: http://www.eGroups.com/list/notetab Free Web-based e-mail groups by eGroups.com
                        Message 11 of 21 , Feb 25, 1999
                        • 0 Attachment
                          Jody wrote:

                          > >This first one will only do lines that have three spaces after a
                          > >hard break leaving all other lines untouched.
                          >
                          > I need to correct that. It should have read three OR MORE spaces.
                          > Anyhow, roger, if I am reading your post right the clip(s) I sent
                          > should do it for you, the latter of the two more of what you asked
                          > for, but my guss is the first would work as well.

                          Yes, I think that will do it. Thanks!

                          Roger

                          ------------------------------------------------------------------------
                          eGroup home: http://www.eGroups.com/list/notetab
                          Free Web-based e-mail groups by eGroups.com
                        • Roger Williams
                          ... Hi, Kay! Good to see your comments. You are right that this is what I want, EXCEPT where the material has been rigidly formatted to create a table (usually
                          Message 12 of 21 , Feb 25, 1999
                          • 0 Attachment
                            Kay Roath wrote:
                            >
                            > 2/24/1999 1:55 AM Roger Williams wrote
                            >
                            > If I understand this thread, you want a clip that will
                            > indent every line that starts with a space by a specified
                            > amount? The 5 in the %fill% line is the # of spaces.

                            Hi, Kay! Good to see your comments.

                            You are right that this is what I want, EXCEPT where the material
                            has been rigidly formatted to create a table (usually a profit
                            and loss statement) in a non-proportional font. Then I don't want
                            to touch it at all, so really it would be helpful to be able to
                            run your clip, or the one of Jody's or Larry's that works on an
                            entire file IF that is appropriate, and only on SELECTED material
                            when I'm trying to avoid screwing up a table. At the moment I am
                            trying to use a clip that finds pairs of occurrences of the table
                            identifier usually included before and after such tabular
                            material, and does something to the text in between (saving it to
                            a temporary file, deleting it, and then reinserting it, or
                            SOMETHING).

                            I always learn from the clips all you experts write. At least
                            when you're not so far above me I don't understand how the clip
                            is supposed to work. <groan>

                            Roger

                            ------------------------------------------------------------------------
                            eGroup home: http://www.eGroups.com/list/notetab
                            Free Web-based e-mail groups by eGroups.com
                          • Roger Williams
                            ... Beautiful. But to get this to work for me, someone would have to talk me through installing Gawk... when I last tried it U ended up with reports of missing
                            Message 13 of 21 , Feb 25, 1999
                            • 0 Attachment
                              David Seidman wrote:

                              > Just to keep things in perspective, Wayne's NoteAwk makes it very easy to
                              > run a gawk script on your NoteTab documents. Here is a script that will
                              > replace an initial one or more spaces (on each line that begins that way)
                              > with five spaces:
                              >
                              > {sub(/^ +/," ")
                              > print}
                              >
                              > (That may not be a very efficient way to write it, though.) If you want to
                              > replace only the first space by five spaces, delete the + in the script.
                              > Used with Wayne's clip, it works on the whole document if you do not select
                              > text; otherwise, it works on the selected text.

                              Beautiful. But to get this to work for me, someone would have to
                              talk me through installing Gawk... when I last tried it U ended
                              up with reports of missing drivers and the computer started
                              locking and eventually I gave up. Partly this was because I
                              thought that if I couldn't master NoteTab clip syntax I probably
                              would find Awk derivatives beyond me.

                              Roger

                              ------------------------------------------------------------------------
                              eGroup home: http://www.eGroups.com/list/notetab
                              Free Web-based e-mail groups by eGroups.com
                            • Kay Roath
                              2/26/1999 1:51 AM Roger Williams wrote ... There is always only one table? Shouldn t this be moved to the advanced list? ... Introduction to NoteTab Clip
                              Message 14 of 21 , Feb 26, 1999
                              • 0 Attachment
                                2/26/1999 1:51 AM Roger Williams wrote

                                > You are right that this is what I want, EXCEPT where the material
                                > has been rigidly formatted to create a table (usually a profit
                                > and loss statement) in a non-proportional font. Then I don't want
                                > to touch it at all, so really it would be helpful to be able to
                                > run your clip, or the one of Jody's or Larry's that works on an
                                > entire file IF that is appropriate, and only on SELECTED material
                                > when I'm trying to avoid screwing up a table. At the moment I am
                                > trying to use a clip that finds pairs of occurrences of the table
                                > identifier usually included before and after such tabular
                                > material, and does something to the text in between (saving it to
                                > a temporary file, deleting it, and then reinserting it, or
                                > SOMETHING).

                                There is always only one table?

                                Shouldn't this be moved to the advanced list?

                                --- Grandma Kay ---
                                Introduction to NoteTab Clip Programming
                                http://notetab.kay.net



                                ------------------------------------------------------------------------
                                eGroup home: http://www.eGroups.com/list/notetab
                                Free Web-based e-mail groups by eGroups.com
                              • Kay Roath
                                2/26/1999 1:51 AM Roger Williams wrote ... This will let you mark one section to skip. It cuts it out. Runs on the rest & then puts it back in where it was.
                                Message 15 of 21 , Feb 26, 1999
                                • 0 Attachment
                                  2/26/1999 1:51 AM Roger Williams wrote

                                  > Kay Roath wrote:
                                  >>
                                  >> 2/24/1999 1:55 AM Roger Williams wrote
                                  >>
                                  >> If I understand this thread, you want a clip that will
                                  >> indent every line that starts with a space by a specified
                                  >> amount? The 5 in the %fill% line is the # of spaces.

                                  > Hi, Kay! Good to see your comments.

                                  > You are right that this is what I want, EXCEPT where the material
                                  > has been rigidly formatted to create a table (usually a profit
                                  > and loss statement) in a non-proportional font. Then I don't want
                                  > to touch it at all, so really it would be helpful to be able to
                                  > run your clip, or the one of Jody's or Larry's that works on an
                                  > entire file IF that is appropriate, and only on SELECTED material
                                  > when I'm trying to avoid screwing up a table. At the moment I am
                                  > trying to use a clip that finds pairs of occurrences of the table
                                  > identifier usually included before and after such tabular
                                  > material, and does something to the text in between (saving it to
                                  > a temporary file, deleting it, and then reinserting it, or
                                  > SOMETHING).

                                  This will let you mark one section to skip.
                                  It cuts it out. Runs on the rest & then puts it back in
                                  where it was.

                                  H=IndentTest
                                  ^!SetWordWrap OFF
                                  ^!Set %save%=^$GetSelection$
                                  ^!Jump Select_Start
                                  ^!Set %where%=^$GetRow$
                                  ^!Set %line%=1
                                  ^!Set %fill%=^$StrFill( ;5)$

                                  :Process
                                  ^!Jump ^%line%
                                  ^!Select LINE
                                  ^!If ^$StrPos("^%space%";"^$GetSelection$";False)$=1 Fix ELSE Next

                                  :Fix
                                  ^!Set %var%=^$StrInsert("^%fill%";"^$StrTrim(^$GetSelection$)$";1)$
                                  ^!InsertText ^%var%^p
                                  ^!Goto Next

                                  :Next
                                  ^!Inc %line%
                                  ^!If ^%line% > ^$GetLineCount$ Done
                                  ^!Goto Process

                                  :Done
                                  ^!Jump ^%where%
                                  ^!InsertText ^%save%

                                  --- Grandma Kay ---
                                  Introduction to NoteTab Clip Programming
                                  http://notetab.kay.net



                                  ------------------------------------------------------------------------
                                  eGroup home: http://www.eGroups.com/list/notetab
                                  Free Web-based e-mail groups by eGroups.com
                                • Roger Williams
                                  ... No. There can be two, sometimes three. Usually one, though. ... Never having dared to look at the advanced list, I wouldn t know. Hey, I don t even
                                  Message 16 of 21 , Feb 26, 1999
                                  • 0 Attachment
                                    Kay Roath wrote:

                                    > There is always only one table?

                                    No. There can be two, sometimes three. Usually one, though.

                                    >
                                    > Shouldn't this be moved to the advanced list?

                                    Never having dared to look at the advanced list, I wouldn't know.
                                    Hey, I don't even understand all that goes on in THIS list!

                                    Roger

                                    ------------------------------------------------------------------------
                                    eGroup home: http://www.eGroups.com/list/notetab
                                    Free Web-based e-mail groups by eGroups.com
                                  • Kay Roath
                                    2/26/1999 2:43 AM Roger Williams wrote ... OK. This one will start from your current location and go until it hits a line with (*T). Then it will look for
                                    Message 17 of 21 , Feb 26, 1999
                                    • 0 Attachment
                                      2/26/1999 2:43 AM Roger Williams wrote

                                      > Kay Roath wrote:

                                      >> There is always only one table?

                                      > No. There can be two, sometimes three. Usually one, though.

                                      OK. This one will start from your current location and go
                                      until it hits a line with (*T). Then it will look for the
                                      next (*T) and jump down one line which should put you at the
                                      next area to fix with a continue option.

                                      It's up to you to position at the start of the doc & get
                                      the (*T)'s in there before you start the clip :)

                                      H=IndentTilTable
                                      ^!SetWordWrap OFF

                                      :Repeat
                                      ^!Set %line%=^$GetRow$
                                      ^!Set %fill%=^$StrFill( ;5)$

                                      :Process
                                      ^!Jump ^%line%
                                      ^!Select LINE
                                      ^!If ^$StrPos("(*T)";"^$GetSelection$";False)$ > 0 Done
                                      ^!If ^$StrPos("^%space%";"^$GetSelection$";False)$=1 Fix ELSE SkipIt

                                      :Fix
                                      ^!Set %var%=^$StrInsert("^%fill%";"^$StrTrim(^$GetSelection$)$";1)$
                                      ^!InsertText ^%var%^p
                                      ^!Goto Next

                                      :SkipIt
                                      ^!Inc %line%
                                      ^!If ^%line% > ^$GetLineCount$ End
                                      ^!Goto Process

                                      :Done
                                      ^!Find (*T) S
                                      ^!Jump +1
                                      ^!Select Line
                                      ^!Continue Repeat?
                                      ^!GoTo Repeat

                                      --- Grandma Kay ---
                                      Introduction to NoteTab Clip Programming
                                      http://notetab.kay.net



                                      ------------------------------------------------------------------------
                                      eGroup home: http://www.eGroups.com/list/notetab
                                      Free Web-based e-mail groups by eGroups.com
                                    • Wayne VanWeerthuizen
                                      ... The recommended version of gawk is a single stand-alone file, and is very easy to install. 1. Download this file:
                                      Message 18 of 21 , Feb 27, 1999
                                      • 0 Attachment
                                        David Seidman wrote:

                                        > Just to keep things in perspective, Wayne's NoteAwk makes it very easy to
                                        > run a gawk script on your NoteTab documents. Here is a script that will
                                        > replace an initial one or more spaces (on each line that begins that way)
                                        > with five spaces:
                                        >
                                        > {sub(/^ +/," ")
                                        > print}
                                        >
                                        > (That may not be a very efficient way to write it, though.) If you want to
                                        > replace only the first space by five spaces, delete the + in the script.
                                        > Used with Wayne's clip, it works on the whole document if you do not select
                                        > text; otherwise, it works on the selected text.

                                        Roger Williams responded:

                                        >Beautiful. But to get this to work for me, someone would have to
                                        >talk me through installing Gawk... when I last tried it U ended
                                        >up with reports of missing drivers and the computer started
                                        >locking and eventually I gave up. Partly this was because I
                                        >thought that if I couldn't master NoteTab clip syntax I probably
                                        >would find Awk derivatives beyond me.

                                        The recommended version of gawk is a single stand-alone file, and
                                        is very easy to install.

                                        1. Download this file:
                                        ftp://oak.oakland.edu/pub/simtelnet/gnu/gnuish/gawk303x.zip

                                        2. Extract the file gawk-w32.exe, and put it anywhere you like.

                                        That is the ONLY file you need from the above zip archive.
                                        The number of other files should no longer be intimidating
                                        once one realizes they are not needed.

                                        3. When you first use NoteAwk, NoteTab will ask you to browse
                                        to the location where you put the gawk-w32.exe file. (Actually
                                        it will ask the first time you use a clip that requires gawk -
                                        not all the NoteAwk clips require gawk.)




                                        --
                                        Wayne M. VanWeerthuizen
                                        ICQ: 15117288
                                        Homepage: http:/landru.myhome.net/wayne


                                        ------------------------------------------------------------------------
                                        eGroup home: http://www.eGroups.com/list/notetab
                                        Free Web-based e-mail groups by eGroups.com
                                      • Roger Williams
                                        ... Yep. This is really getting there! Much, much appreciated. And others from Larry and Jody. I was embarassed to ask, but it looks as if it needs some pretty
                                        Message 19 of 21 , Feb 28, 1999
                                        • 0 Attachment
                                          Kay Roath wrote (in response to something from me):

                                          > >> There is always only one table?
                                          >
                                          > > No. There can be two, sometimes three. Usually one, though.
                                          >
                                          > OK. This one will start from your current location and go
                                          > until it hits a line with (*T). Then it will look for the
                                          > next (*T) and jump down one line which should put you at the
                                          > next area to fix with a continue option.
                                          >
                                          > It's up to you to position at the start of the doc & get
                                          > the (*T)'s in there before you start the clip :)

                                          Yep. This is really getting there! Much, much appreciated. And
                                          others from Larry and Jody. I was embarassed to ask, but it looks
                                          as if it needs some pretty nifty clip-writing to do exactly what
                                          I needed.

                                          >
                                          > H=IndentTilTable
                                          > ^!SetWordWrap OFF
                                          >
                                          > :Repeat
                                          > ^!Set %line%=^$GetRow$
                                          > ^!Set %fill%=^$StrFill( ;5)$
                                          >
                                          > :Process
                                          > ^!Jump ^%line%
                                          > ^!Select LINE
                                          > ^!If ^$StrPos("(*T)";"^$GetSelection$";False)$ > 0 Done
                                          > ^!If ^$StrPos("^%space%";"^$GetSelection$";False)$=1 Fix ELSE SkipIt
                                          >
                                          > :Fix
                                          > ^!Set %var%=^$StrInsert("^%fill%";"^$StrTrim(^$GetSelection$)$";1)$
                                          > ^!InsertText ^%var%^p
                                          > ^!Goto Next
                                          >
                                          > :SkipIt
                                          > ^!Inc %line%
                                          > ^!If ^%line% > ^$GetLineCount$ End
                                          > ^!Goto Process
                                          >
                                          > :Done
                                          > ^!Find (*T) S
                                          > ^!Jump +1
                                          > ^!Select Line
                                          > ^!Continue Repeat?
                                          > ^!GoTo Repeat

                                          Thanks again,

                                          Roger

                                          ------------------------------------------------------------------------
                                          eGroup home: http://www.eGroups.com/list/notetab
                                          Free Web-based e-mail groups by eGroups.com
                                        • Roger Williams
                                          ... I must correct the above, specially in the light of the helpful (and very simple) instructions that Wayne appended. In fact, I was trying to install first
                                          Message 20 of 21 , Feb 28, 1999
                                          • 0 Attachment
                                            Wayne VanWeerthuizen wrote, quoting me:

                                            > >Beautiful. But to get this to work for me, someone would have to
                                            > >talk me through installing Gawk... when I last tried it U ended
                                            > >up with reports of missing drivers and the computer started
                                            > >locking and eventually I gave up. Partly this was because I
                                            > >thought that if I couldn't master NoteTab clip syntax I probably
                                            > >would find Awk derivatives beyond me.

                                            I must correct the above, specially in the light of the helpful
                                            (and very simple) instructions that Wayne appended. In fact, I
                                            was trying to install first Perl, and then Awk. I though gAwk was
                                            a simple derivative of the latter. Anyway, it was in this
                                            process, invovling many files, that I got zapped by missing DLLs,
                                            etc., so I shouldn't have blamed gAwk! Sorry about that.

                                            >
                                            > The recommended version of gawk is a single stand-alone file, and
                                            > is very easy to install.
                                            >
                                            > 1. Download this file:
                                            > ftp://oak.oakland.edu/pub/simtelnet/gnu/gnuish/gawk303x.zip
                                            >
                                            > 2. Extract the file gawk-w32.exe, and put it anywhere you like.
                                            >
                                            > That is the ONLY file you need from the above zip archive.
                                            > The number of other files should no longer be intimidating
                                            > once one realizes they are not needed.
                                            >
                                            > 3. When you first use NoteAwk, NoteTab will ask you to browse
                                            > to the location where you put the gawk-w32.exe file. (Actually
                                            > it will ask the first time you use a clip that requires gawk -
                                            > not all the NoteAwk clips require gawk.)

                                            That couldn't be either easier or clearer... not unless Eric
                                            decided to bundle it with the program itself (!)

                                            Thanks for the help. I'll have to wait until this evening before
                                            I can get around to it... very busy day, today.

                                            Roger

                                            ------------------------------------------------------------------------
                                            eGroup home: http://www.eGroups.com/list/notetab
                                            Free Web-based e-mail groups by eGroups.com
                                          • Nicole Simon
                                            ... No, he shouldn t. Gawk ist only to be distibuted, when the whole package ist distributed; and it is very easy to install like Wayne described it. Nicole --
                                            Message 21 of 21 , Mar 1, 1999
                                            • 0 Attachment
                                              Roger Williams wrote:
                                              > That couldn't be either easier or clearer... not unless Eric
                                              > decided to bundle it with the program itself (!)

                                              No, he shouldn't. Gawk ist only to be distibuted, when the whole package
                                              ist distributed; and it is very easy to install like Wayne described it.

                                              Nicole

                                              --
                                              Dust Puppy: »Well. It is a long story ...
                                              but every saga has a beginning.«
                                              Greg: »You waited for days to use that line, didn't you.«
                                              User friendly (www.userfriendly.org) - 1998-11-27

                                              ------------------------------------------------------------------------
                                              eGroup home: http://www.eGroups.com/list/notetab
                                              Free Web-based e-mail groups by eGroups.com
                                            Your message has been successfully submitted and would be delivered to recipients shortly.