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

Disk replace in Standard

Expand Messages
  • Jeff Scism
    I am doing global replacements in NoteTab Standard. I need to remove all HTML Head coding in all htm files in a directory, and its subfolders, (I already
    Message 1 of 11 , Jun 12, 2004
      I am doing global replacements in NoteTab Standard.

      I need to remove all HTML "Head" coding in all htm files in a directory,
      and its subfolders, (I already know how to get the replace to do
      globals with Control+d)

      How do I get the process (via a clip) to automatically seek out
      </head>, and delete everything before it, replacing it with the coding
      that will standardize all pages?

      (and is there a way to toggle off word wrap in all documents in a sub
      directory? I have done it before using the Keyboard command as a part
      of the clip on OPEN docs.)


      --
      ``

      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.
      ~~~~
    • John Zeman
      ... directory, ... coding ... sub ... part ... Recently I d made a clip similar to what search disk does so it didn t take much modification to do what you
      Message 2 of 11 , Jun 12, 2004
        --- In ntb-clips@yahoogroups.com, Jeff Scism <scismgenie@a...> wrote:
        > I am doing global replacements in NoteTab Standard.
        >
        > I need to remove all HTML "Head" coding in all htm files in a
        directory,
        > and its subfolders, (I already know how to get the replace to do
        > globals with Control+d)
        >
        > How do I get the process (via a clip) to automatically seek out
        > </head>, and delete everything before it, replacing it with the
        coding
        > that will standardize all pages?
        >
        > (and is there a way to toggle off word wrap in all documents in a
        sub
        > directory? I have done it before using the Keyboard command as a
        part
        > of the clip on OPEN docs.)
        >
        >
        > --
        > ``
        >
        > Jeffery G. Scism. IBSSG


        Recently I'd made a clip similar to what search disk does so it
        didn't take much modification to do what you want.

        I took what you said literally Jeff, meaning you wish to delete
        everything AHEAD of </head> in all documents. If you instead meant
        to delete everything ahead of </head> including </head> then you
        should change the

        ^!Jump SELECT_START

        Line to:

        ^!Jump SELECT_END

        Put the new code to be used in a new empty text file. In my example
        below I used:

        C:\Mine\Upload\home\newcode.tmp

        Also, the line in the clip that would normally save each page after
        it was processed is commented out. So if the clip does not do what
        you want, you won't lose the originals (unless of course you do save
        them).

        Change the value assigned to the %PATH% variable from

        C:\Mine\Upload\home\

        to where your files are, and if necessary, the file types from *.htm*
        to what you want.

        Finally, I do not know why this would not work on Standard, but I do
        not use Standard so I cannot say that for sure.

        I'll leave the word wrap part of your questions for someone else to
        answer, there's a nasty storm moving in fast so I have to shut things
        down.

        John

        ; begin clip =======================

        ~temp3

        ; SET FULL PATH TO SEARCH (PRECEDE WITH A +
        ; TO INCLUDE SUBDIRECTORIES
        ^!Set %PATH%=C:\Mine\Upload\home\
        ; SET TYPE OF FILE (WILDCARDS OK
        ^!Set %TYPE%=*.htm*

        ; THE NEW IMPROVED CODE THAT WILL BE USED AS THE
        ; REPLACEMENT CODE IS STORED IN THE FOLLOWING
        ; FILE. OPEN IT AND ASSIGN ITS CONTENTS TO A VAR
        ^!OpenReadOnly "C:\Mine\Upload\home\newcode.tmp"
        ^!Set %NEWCODE%=^$GetText$
        ^!Close Discard

        ^!SetWizardTitle Search in:
        ^!SetWizardLabel ^%PATH%
        ^!Set %CNT%=0
        ^!SetArray %FILES%=^$GetFiles("^%PATH%";^%TYPE%;;Name)$
        ^!StatusShow Please Wait.Searching files for </head>
        ^!SetScreenUpdate Off

        :Loop
        ^!Inc %CNT%
        ^!Open ^%FILES^%CNT%%
        ^!Find "</head>" TIWS
        ^!IfError CloseIt
        ^!Jump SELECT_START
        ; SELECT EVERYTHING PRECEDING </HEAD>
        ^!SelectTo 1:1
        ; NOW REPLACE WHAT IS SELECTED WITH NEW CODE
        ^!InsertHtml ^%NEWCODE%

        ; save the file
        ;^!Save

        ^!If "^%CNT%" < "^%FILES0%" Loop
        ^!GoTo End

        :CloseIt
        ; IF THE FILE WAS ALREADY OPEN AND MODIFIED DO NOT CLOSE IT
        ^!If "^$IsModified$" = "1" skip_1
        ^!Close ^%FILES^%CNT%%
        ^!If "^%CNT%" < "^%FILES0%" Loop
      • John Zeman
        ... One storm cell went through but another is coming in behind it so I m only online again for a moment. I noticed in my previous post that in the clip I
        Message 3 of 11 , Jun 12, 2004
          --- In ntb-clips@yahoogroups.com, "John Zeman" <john041650@y...>
          wrote:

          > ; begin clip =======================
          >
          > ~temp3
          >
          >


          One storm cell went through but another is coming in behind it so I'm
          only online again for a moment.

          I noticed in my previous post that in the clip I inadvertently forgot
          to take out

          ~temp3

          At the top of it. That's the name of the clip. I have a series of
          clips titles named ~temp1 ~temp2 etc for storing temporary clips I
          want to experiment with. It should not have been included in my first
          answer to you.

          John
        • Jeff Scism
          I am apparently doing something wrong, I get a line error in line 22 (open) -- `` Jeffery G. Scism. IBSSG Genealogy is the art of the living haunting the
          Message 4 of 11 , Jun 12, 2004
            I am apparently doing something wrong, I get a line error in line 22 (open)

            --
            ``

            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.
            ~~~~
          • John Zeman
            ... 22 (open) ... Well I just checked the NoteTab site for the differences between Standard and Pro and I don t see anything that should prevent the clip from
            Message 5 of 11 , Jun 12, 2004
              --- In ntb-clips@yahoogroups.com, Jeff Scism <scismgenie@a...> wrote:
              > I am apparently doing something wrong, I get a line error in line
              22 (open)
              >
              > --
              > ``
              >
              > Jeffery G. Scism. IBSSG
              >


              Well I just checked the NoteTab site for the differences between
              Standard and Pro and I don't see anything that should prevent the
              clip from working for you.

              What exact error do you get? I assume by line 22 you're referring to
              this one:

              ^!Open ^%FILES^%CNT%%


              John
            • Jeff Scism
              Line 22: clip syntax error OPEN is the error after replacing the line of the clip. -- `` Jeffery G. Scism. IBSSG Genealogy is the art of the living
              Message 6 of 11 , Jun 12, 2004
                Line 22: clip syntax error OPEN ""

                is the error after replacing the line of the clip.

                --
                ``

                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.
                ~~~~
              • John Zeman
                ... 22 (open) ... Oh wait, I think I found it. My original clip searched files in directories that did not have any spaces in the full path. So it did not
                Message 7 of 11 , Jun 12, 2004
                  --- In ntb-clips@yahoogroups.com, Jeff Scism <scismgenie@a...> wrote:
                  > I am apparently doing something wrong, I get a line error in line
                  22 (open)
                  >
                  > --
                  > ``
                  >
                  > Jeffery G. Scism. IBSSG


                  Oh wait, I think I found it. My original clip searched files in
                  directories that did not have any spaces in the full path. So it did
                  not need the double quotes around the full file path/name. Try
                  changing that line to:

                  ^!Open "^%FILES^%CNT%%"

                  And then see if it works.

                  John
                • Jeff Scism
                  I know about those storm watches, no hurry on getting this, I have been working to clean up this site for two years now, and it is finally looking
                  Message 8 of 11 , Jun 12, 2004
                    I know about those storm watches, no hurry on getting this, I have been
                    working to "clean up" this site for two years now, and it is finally
                    "looking" presentable, I started with NO HTML experience, and NoteTab
                    has taught me alot.

                    --
                    ``

                    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.
                    ~~~~
                  • John Zeman
                    You also should put double quotes around this line too near the end of the clip. ^!Close ^%FILES^%CNT%% So it becomes: ^!Close ^%FILES^%CNT%% Sorry for the
                    Message 9 of 11 , Jun 12, 2004
                      You also should put double quotes around this line too near the end
                      of the clip.

                      ^!Close ^%FILES^%CNT%%

                      So it becomes:

                      ^!Close "^%FILES^%CNT%%"

                      Sorry for the confusion Jeff, I'm dodging too many storms and not
                      able to take my time doing this.

                      John
                    • John Zeman
                      ... been ... finally ... NoteTab ... At the moment the storms are holding but that could change any second. Can you post the clip back here so I can look for
                      Message 10 of 11 , Jun 12, 2004
                        --- In ntb-clips@yahoogroups.com, Jeff Scism <scismgenie@a...> wrote:
                        > I know about those storm watches, no hurry on getting this, I have
                        been
                        > working to "clean up" this site for two years now, and it is
                        finally
                        > "looking" presentable, I started with NO HTML experience, and
                        NoteTab
                        > has taught me alot.
                        >
                        > --
                        > ``
                        >
                        > 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.
                        > ~~~~

                        At the moment the storms are holding but that could change any second.

                        Can you post the clip back here so I can look for any differences
                        between yours and my original?

                        John
                      • John Zeman
                        I just got your email Jeff and will respond to you that way from now on regarding this thread so we don t clutter up this board. But for anyone else following
                        Message 11 of 11 , Jun 12, 2004
                          I just got your email Jeff and will respond to you that way from now
                          on regarding this thread so we don't clutter up this board.

                          But for anyone else following this, here is what is probably wrong.

                          Jeff is using the offline URL path to his folder of files. Instead
                          of this:

                          File:///C:/allgenealogy/all-genealogy-websites/inmontgo/bios/

                          He needs to use:

                          C:\allgenealogy\all-genealogy-websites\inmontgo\bios\

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