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

Opening multiple files into one

Expand Messages
  • John Shotsky
    I have an application that places many .html files into a folder. I would like to open them into a single document, all concatenated together without opening
    Message 1 of 7 , Jun 2, 2009
    • 0 Attachment
      I have an application that places many .html files into a folder. I would like to open them into a single document, all
      concatenated together without opening the individual files separately. Is this possible in NoteTab? (I know how to do it
      with Dos, but I'd rather just do a multi-select and grab only the files I select.)

      TIA,
      John




      [Non-text portions of this message have been removed]
    • ebbtidalflats
      If you know how to do it in DOS cou could use the Shell command (just kidding), or try the following (I don t have NoteTab running, so the functions below are
      Message 2 of 7 , Jun 4, 2009
      • 0 Attachment
        If you know how to do it in DOS cou could use the Shell command
        (just kidding), or try the following (I don't have NoteTab running, so the functions below are guesses, and of course you'll have to provide a place for the inserts, and a home for the clipcode):

        ^!SetListDelimiter |
        ^!SetArray %allfiles%=^$GetFiles(path to folder)$
        ^!SetArray %selections%=^?{(T=A;H=^%allfiles0%)Select files}
        :loop
        ^!InsertFile ^%selection^%selection0%%
        ^!Dec %selection0%
        ^!If ^%selection0%>0 loop

        Cheers,

        Eb

        --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
        >
        > I have an application that places many .html files into a folder. I would like to open them into a single document, all
        > concatenated together without opening the individual files separately. Is this possible in NoteTab? (I know how to do it
        > with Dos, but I'd rather just do a multi-select and grab only the files I select.)
      • Alec Burgess
        John: One of Jody s libraries DirStuff contains some Append clips which might help you out (plus other useful goodies) ... ebbtidalflats
        Message 3 of 7 , Jun 4, 2009
        • 0 Attachment
          John:
          One of Jody's libraries "DirStuff" contains some Append clips which
          might help you out (plus other useful goodies)
          > DirStuff.zip http://www.notetab.com/clipbooks/dirstuff.zip
          > by Jody Adair, 01 Jul 2000
          > Directory Stuff: The ultimate in directory tools! Rename extensions,
          > open directories, reopen alphabetically, DOS stuff, append files to
          > one, files to outline, HTML files to text, remove spaces in file
          > names, convert cases, recycle directory, checkboxes, setup to remember
          > paths, more...
          > Address : <http://www.notetab.com/libraries.php?cat=utilities>

          ebbtidalflats (ebbtidalflats@...) wrote (in part) (on 2009-06-04
          at 10:02):
          > If you know how to do it in DOS cou could use the Shell command
          > (just kidding), or try the following (I don't have NoteTab running,
          > so the functions below are guesses, and of course you'll have to
          > provide a place for the inserts, and a home for the clipcode):
          >
          > ^!SetListDelimiter |
          > ^!SetArray %allfiles%=^$GetFiles(path to folder)$
          > ^!SetArray %selections%=^?{(T=A;H=^%allfiles0%)Select files}
          > :loop
          > ^!InsertFile ^%selection^%selection0%%
          > ^!Dec %selection0%
          > ^!If ^%selection0%>0 loop
          >
          > Cheers,
          >
          > Eb
          >
          > --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
          > > >
          > > > I have an application that places many .html files into a folder.
          > I would like to open them into a single document, all
          > > > concatenated together without opening the individual files
          > separately. Is this possible in NoteTab? (I know how to do it
          > > > with Dos, but I'd rather just do a multi-select and grab only the
          > files I select.)

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




          [Non-text portions of this message have been removed]
        • hsavage
          ... I would like to open them into a single document, all concatenated together without opening the individual files separately. Is this possible in NoteTab?
          Message 4 of 7 , Jun 4, 2009
          • 0 Attachment
            John Shotsky wrote:
            > I have an application that places many .html files into a folder.
            I would like to open them into a single document, all> concatenated
            together without opening the individual files separately. Is this
            possible in NoteTab? (I know how to do it with Dos, but I'd rather just
            do a multi-select and grab only the files I select.)
            >
            > TIA,
            > John

            John,

            Yes, it is possible in NoteTab. Things like this are what's so great
            about NoteTab!

            I wrote this short clip to do what you asked about, loading multiple
            html files concatenating them into one file. This clip also strips the
            htmltags from the newly created file.

            If you have some very large files or an extremely high number of files
            the clip may develop a timing problem. I concatenated and stripped tags
            from a folder of 59 html files with no trouble.

            Clip follows;
            --------------------------------------
            H="ConCatenate_HTMLFiles"
            ; • Modified-Updated~Created_2009.06.04
            ; • hrs ø hsavage·pobox·com_11:58:50a
            ^!Clearvariables
            ^!SetScreenUpdate 0
            ;
            ^!SetListDelimiter |
            ^!Set %path%="^?{(T=D)Set HTML Source Path=C:\+r2rWeb\fsOTW\}";
            %dest%="^?{(T=D)Set HTML Destination Path=C:\+r2rweb\lists\}";
            %subs%=^?{Show SubFolder\Files in Path==YES^=+|_NO^=^%empty%};
            %select%=^?{Show Files Pre-Selected==YES^=_|_NO^=^%empty%}
            ^!Set %files%=^$GetFiles("^%subs%^%path%";*.*htm?;;unsorted)$
            ^!If ^%files%=^%EMPTY% END
            ^!Set %files%=^$StrReplace("^%path%";"^%select%";"^%files%";0;0)$
            ^!SetWizardWidth 125
            ^!SetArray %files%=^?{(T=A;H=26)HTML FILES TO CONCATENATE!==^%files%}
            ^!Set %Count%=^%files0%; %index%=0
            ^!If ^%files0% = 0 END
            ;
            :LOOP
            ^!StatusShow ~~~ConCatenating Selected Html Files~~~
            ^!Inc %index%
            ^!If ^%index% > ^%Count% END
            ^!AppendToFile "^%dest%Concatenated.txt"
            ^$GetFileText(^%path%^%files^%index%%)$
            ^!Delay 1
            ^!Goto LOOP
            ;
            :END
            ^!Open "^%dest%Concatenated.txt"
            ^!Menu Modify/Strip Html Tags/Remove All Tags
            ^$StrTrim("^$GetSelection$")$
            ^!Save
            ------------------------------

            You may want to edit the source and destination paths to suit your needs.
            The set path line is very long, you will probably have to remove
            erroneous linefeeds to make the clip work properly.


            ·············································
            ºvº SL_day# 155 - created 2009.06.04_21.13.33

            In Only 30 Years...
            • 1977: Hoping for a BMW
            • 2007: Hoping for a BM

            € hrs € hsavage € pobox € com
          • ebbtidalflats
            John, All suggested solutions are essentially the same. They just have more or less fluff. The essence of combining several files into one using notetab is:
            Message 5 of 7 , Jun 5, 2009
            • 0 Attachment
              John,

              All suggested solutions are essentially the same.
              They just have more or less fluff.

              The essence of combining several files into one
              using notetab is:

              ;1. set your path before the following code
              ^!Set %path%=^?{(t=D)browse to the desired folder}

              ;2. collect the filenames (include paths)
              ^!SetListDelimiter |
              ^!SetArray %allfiles%=^$GetFiles(^%path%;*.html)$

              ;3. Select the files you want to append (one line)
              ^!SetArray %selections%=^?{(T=A;H=^%allfiles0%)Select files=^%allfiles%}

              ;4. loop through the filelist to insert the
              files into the current document
              (or append them to an external file)

              :loop
              ^!InsertFile ^%selection^%selection0%%
              ^!Dec %selection0%
              ^!If ^%selection0%>0 loop

              Note that this loop is where the various solutions differ.
              Using a separate variable to track which file to insert
              lets you insert files in any order. The above solutions
              inserts the files in reverse order. I urge you to read
              up on the ^$GetFiles function in the help file.



              Eb

              --- In ntb-clips@yahoogroups.com, "ebbtidalflats" <ebbtidalflats@...> wrote:
              >
              > If you know how to do it in DOS cou could use the Shell command
              > (just kidding), or try the following (I don't have NoteTab running, so the functions below are guesses, and of course you'll have to provide a place for the inserts, and a home for the clipcode):
              >
              > ^!SetListDelimiter |
              > ^!SetArray %allfiles%=^$GetFiles(path to folder)$
              > ^!SetArray %selections%=^?{(T=A;H=^%allfiles0%)Select files}
              > :loop
              > ^!InsertFile ^%selection^%selection0%%
              > ^!Dec %selection0%
              > ^!If ^%selection0%>0 loop
              >
              > Cheers,
              >
              > Eb
              >
              > --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@> wrote:
              > >
              > > I have an application that places many .html files into a folder. I would like to open them into a single document, all
              > > concatenated together without opening the individual files separately. Is this possible in NoteTab? (I know how to do it
              > > with Dos, but I'd rather just do a multi-select and grab only the files I select.)
              >
            • Sheri
              ... I noticed the above sets an array variable that ends with the letter s but tries to read it using a variable name that is missing the s . Untested, but
              Message 6 of 7 , Jun 5, 2009
              • 0 Attachment
                ebbtidalflats wrote:
                > John,
                >
                > All suggested solutions are essentially the same.
                > They just have more or less fluff.
                >
                > The essence of combining several files into one
                > using notetab is:
                >
                > ;1. set your path before the following code
                > ^!Set %path%=^?{(t=D)browse to the desired folder}
                >
                > ;2. collect the filenames (include paths)
                > ^!SetListDelimiter |
                > ^!SetArray %allfiles%=^$GetFiles(^%path%;*.html)$
                >
                > ;3. Select the files you want to append (one line)
                > ^!SetArray %selections%=^?{(T=A;H=^%allfiles0%)Select files=^%allfiles%}
                >
                > ;4. loop through the filelist to insert the
                > files into the current document
                > (or append them to an external file)
                >
                > :loop
                > ^!InsertFile ^%selection^%selection0%%
                > ^!Dec %selection0%
                > ^!If ^%selection0%>0 loop
                >
                > Note that this loop is where the various solutions differ.
                > Using a separate variable to track which file to insert
                > lets you insert files in any order. The above solutions
                > inserts the files in reverse order. I urge you to read
                > up on the ^$GetFiles function in the help file.
                >
                >
                >
                > Eb
                >
                > --- In ntb-clips@yahoogroups.com, "ebbtidalflats" <ebbtidalflats@...> wrote:
                >
                >> If you know how to do it in DOS cou could use the Shell command
                >> (just kidding), or try the following (I don't have NoteTab running, so the functions below are guesses, and of course you'll have to provide a place for the inserts, and a home for the clipcode):
                >>
                >> ^!SetListDelimiter |
                >> ^!SetArray %allfiles%=^$GetFiles(path to folder)$
                >> ^!SetArray %selections%=^?{(T=A;H=^%allfiles0%)Select files}
                >> :loop
                >> ^!InsertFile ^%selection^%selection0%%
                >> ^!Dec %selection0%
                >> ^!If ^%selection0%>0 loop
                >>
                >> Cheers,
                >>
                >> Eb
                >>
                >>
                I noticed the above sets an array variable that ends with the letter "s"
                but tries to read it using a variable name that is missing the "s".
                Untested, but that's not going to work.

                Regards,
                Sheri
                >> --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@> wrote:
                >>
                >>> I have an application that places many .html files into a folder. I would like to open them into a single document, all
                >>> concatenated together without opening the individual files separately. Is this possible in NoteTab? (I know how to do it
                >>> with Dos, but I'd rather just do a multi-select and grab only the files I select.)
                >>>
                >
                >
              • ebbtidalflats
                ... Thanks for pointing this out. Don t know how that could have happened ;). I got a wireless keyboard. You don t suppose someone else is typing on the same
                Message 7 of 7 , Jun 7, 2009
                • 0 Attachment
                  --- In ntb-clips@yahoogroups.com, Sheri <silvermoonwoman@...> wrote:
                  >
                  > ebbtidalflats wrote:
                  > >> ^!SetListDelimiter |
                  > >> ^!SetArray %allfiles%=^$GetFiles(path to folder)$
                  > >> ^!SetArray %selections%=^?{(T=A;H=^%allfiles0%)Select files}
                  > >> :loop
                  > >> ^!InsertFile ^%selection^%selection0%%
                  > >> ^!Dec %selection0%
                  > >> ^!If ^%selection0%>0 loop

                  > I noticed the above sets an array variable that ends with the letter "s"
                  > but tries to read it using a variable name that is missing the "s".
                  > Untested, but that's not going to work.
                  >
                  > Regards,
                  > Sheri



                  Thanks for pointing this out. Don't know how that could have happened ;). I got a wireless keyboard. You don't suppose someone else is typing on the same frequency?

                  Fastes fix, remove the s in the array declaration.

                  Cheers

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