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

Concatenate Text Files

Expand Messages
  • Trey Beck
    Is there a simple way to concatenate all (or a selection) of the text files in a directory using a clip? I ve been using the insert file command, but after
    Message 1 of 3 , Aug 7, 2003
    • 0 Attachment
      Is there a simple way to concatenate all (or a selection) of the text files
      in a directory using a clip? I've been using the "insert file" command, but
      after 30 times it gets a little old...

      I did a search on the archives but couldn't find something exactly like
      this.

      Thanks,
      Michael

      _________________________________________________________________
      The new MSN 8: smart spam protection and 2 months FREE*
      http://join.msn.com/?page=features/junkmail
    • Pat
      ... There is a clip in Jody s dirstuff.clb -- Checkbox append -- it has the option to insert a line of text to indicate the end-begining of files. here s a
      Message 2 of 3 , Aug 7, 2003
      • 0 Attachment
        At 8/7/2003, you wrote:
        >Is there a simple way to concatenate all (or a selection) of the text files
        >in a directory using a clip? I've been using the "insert file" command, but
        >after 30 times it gets a little old...


        There is a clip in Jody's dirstuff.clb --

        Checkbox append -- it has the option to insert a line of text to indicate the end-begining of files.

        here's a direct link to download that the library.
        http://www.notetab.net/zip/dirstuff.zip

        paT
      • hsavage
        ... files ... command, but ... Michael, Following are 2 clips in it, the first clip is used to decode the second clip. The reason for this is, email wraps
        Message 3 of 3 , Aug 7, 2003
        • 0 Attachment
          Trey Beck wrote:

          > Is there a simple way to concatenate all (or a selection) of the text
          files
          > in a directory using a clip? I've been using the "insert file"
          command, but
          > after 30 times it gets a little old...
          >
          > I did a search on the archives but couldn't find something exactly like
          > this.
          >
          > Thanks,
          > Michael

          Michael,

          Following are 2 clips in it, the first clip is used to decode the second
          clip. The reason for this is, email wraps single long lines and
          sometimes it's difficult to manually unwrap them properly.

          To avoid this hassle the clip you need is in 2 forms. The first form is
          encoded with a fixed line length that fits nicely into almost any email
          client without getting wrapped.

          The second form is straight text if that is what you prefer, good luck
          getting the long lines straightened correctly.

          This 2nd clip, once you get it added to a clipbook and working, will,
          • let you select a single folder,
          • let you select a single folder and include its subfolders,
          • let you select the file extension you choose - you mentioned .txt files.
          • let you select no files, so you can select them individually.
          • let you pre-select all files in the folder and subfolders.

          When you make your selections and continue the clip will copy all text
          from the selected files in to a new file, it also places a marker after
          the text of each file indicating which file the text was copied from. I
          used the name Multi-File text.txt for the new file, you can change it to
          what ever you like.


          If you decide to try decoding just follow the instructions 'To DECODE'
          below.

          Otherwise, you can add the 3rd clip to a clipbook and try to manually
          unwrap any email wrapped lines. It's up to you, good luck.

          To DECODE:
          • Select and copy, all text between markers to new blank document.

          • With the new document;
          • Select and copy first clip and 'Add from Clipboard' into a clipbook.
          • Don't forget to save the clipbook you just added to.
          • The clip 'UUD kwik will appear in the clipbook with the clips already
          there.
          • Place the cursor anywhere within the encoded text of the new document.
          • Run the clip, 'UUD kwik' you just added to a clipbook.
          • Encoded text should be decoded without wrapped lines.
          • Select and copy decoded text and 'Add from Clipboard' into a clipbook.


          hrs


          ---copy below this line to end marker after the 3rd clip---
          H="UUD kwik"
          ;_Modified~Updated~Created_7/30/03_11:12:16a
          ;_hsavage@...
          ^!Clearvariables
          ^!Set %ww%=^$IsWordWrap$
          ^!SetScreenUpdate 0
          ^!SetWordWrap 0
          ^!SetDebug 0
          ^!Set %ct%=^$DecToChar(164)$^$DecToChar(169)$
          ^!Find "begin 600" TIBSA
          ^!Set %begin%=^$GetRow$
          ^!Find "end" TISA
          ^!Set %end%=^$GetRow$
          ^!Jump LINE_END
          ^!SelectTo ^%begin%:1
          ^!Replace "begin 600^p" >> "begin 600 ^p" TIHSA
          ^!SetCode %text%=^$StrUUDecode(^$StrTrim(^$GetSelection$)$)$
          ^!SetCode %text%=^$StrReplace("^%ct%";"^";^%text%;0;0)$
          ^!SetClipboard ^%text%
          ^!InsertCode ^%text%
          :END
          ^!SetCursor ^%begin%:1
          ^!SetView ^%begin%:1
          ^!SetWordWrap ^%ww%


          begin 600
          M2#TB0T]-4$]53D1I;F<@1DE,151%6%0B#0JDJ2%#;&5A<G9A<FEA8FQE<PT*
          MI*DA4V5T4V-R965N57!D871E(#`-"CI35$%25`T*I*DA4V5T5VEZ87)D5&ET
          M;&4@0TA!3D=%($9)3$4@05144DE"551%4RXN*%-(4D$I#0JDJ2%39717:7IA
          M<F1,86)E;"!/3DQ9(%1%6%0@1DE,15,@5TE,3"!"12!)3B!&24Q%3$E35"XN
          M+@T*.R!U;F1E<B!F:6QE='EP97,@=&\@9&ES<&QA>2!M86ME(&%N>0T*.R!A
          M9&1I=&EO;G,@;V8@9&5L971I;VYS(&YE8V5S<V%R>0T*I*DA4V5T("5D969P
          M871H)3VDJ3][*$@],S([5#U$*5!)0TL@1DE,12!&3TQ$15(]I*DD1V5T1&]C
          M=6UE;G10871H)'T[("5E>'0E/:2I/WM024-+($]2(%194$4@24X@1DE,15,@
          M5$\@1$E34$Q!63U?04Q,($9)3$53I*D]*GQ46%1\24Y)?$-,0GQ#5$)\1$%4
          M?3L@)7!L=7,E/:2I/WM354)&3TQ$15)3/ST]24Y#3%5$1:2I/2M\7T580TQ5
          M1$6DJ3VDJ25E;7!T>25].R`E<V5L96-T)3VDJ3][05543U-%3$5#5"!&24Q%
          M4S\]/5E%4Z2I/5]\7TY/I*D]I*DE96UP='DE?0T*.PT*I*DA4V5T3&ES=$1E
          M;&EM:71E<B!\I*DE<V5L96-T)0T*I*DA4V5T("5F:6QE;&ES="4]I*DD1V5T
          M1FEL97,H(J2I)7!L=7,EI*DE9&5F<&%T:"4B.RHNI*DE97AT)3MT>7!E*20-
          M"J2I(5-E="`E9FEL96QI<W0E/:2I)%-T<E)E<&QA8V4H(J2I)61E9G!A=&@E
          M(CNDJ25E;7!T>24[(J2I)69I;&5L:7-T)2([,#LP*20-"J2I(5-E=$%R<F%Y
          M("5F:6QE;&ES="4]I*D_>RA(/3(T.U0]02D@1DE,15,@5TE42"!%3E1%4D5$
          M($%45%))0E,@+2T@3F\@8VAO:6-E('%U:71S/3VDJ25S96QE8W0EI*DE9FEL
          M96QI<W0E?0T*I*DA268@I*DE9FEL96QI<W0E/:2I)65M<'1Y)2!%3D0-"CI4
          M05-+#0JDJ2%-96YU($9I;&4O3F5W#0JDJ2%397138W)E96Y5<&1A=&4@,`T*
          MI*DA4V%V92!!4R`BI*DD1V5T1&]C=6UE;G10871H)$UU;'1I+49I;&4@=&5X
          M="YT>'0B#0JDJ2%3970@)6-O=6YT)3VDJ25F:6QE;&ES=#`E.R`E:6YD97@E
          M/3`-"CI.15A45$%32PT*I*DA26YC("5I;F1E>"4-"J2I(4EF(*2I)6EN9&5X
          M)2`^(*2I)6-O=6YT)2!%3D0-"J2I(5-E="`E9FEL971E>'0E/:2I)$=E=$9I
          M;&5497AT*"*DJ25D969P871H):2I)69I;&5L:7-TI*DE:6YD97@E)2(I)`T*
          MI*DA4V5T("5F:6QE;F%M924]I*DE9&5F<&%T:"6DJ21'971&:6QE3F%M92@B
          MI*DE9FEL96QI<W2DJ25I;F1E>"4E(BDD#0H[#0H[I*DA26YF;R`BI*DE9&5F
          M<&%T:"6DJ25F:6QE;&ES=*2I)6EN9&5X)24B#0JDJ2%);G-E<G1497AT(*2I
          M)%-T<E1R:6TH(J2I)69I;&5T97AT)2(I)`T*I*DA26YS97)T5&5X=""DJ25N
          M;"6DJ213=')&:6QL*%\[-2DD5$585"!&4D]-(*2I)69I;&5N86UE):2I)%-T
          M<D9I;&PH7SLU*22DJ25N;"6DJ25N;"4-"J2I(4IU;7`@5$585%]%3D0-"J2I
          4(4=O=&\@3D585%1!4TL-"CI%3D0
          `
          end


          H="COMPOUNDing FILETEXT"
          ^!Clearvariables
          ^!SetScreenUpdate 0
          :START
          ^!SetWizardTitle CHANGE FILE ATTRIBUTES..(SHRA)
          ^!SetWizardLabel ONLY TEXT FILES WILL BE IN FILELIST...
          ; under filetypes to display make any
          ; additions of deletions necessary
          ^!Set %defpath%=^?{(H=32;T=D)PICK FILE FOLDER=^$GetDocumentPath$};
          %ext%=^?{PICK OR TYPE IN FILES TO DISPLAY=_ALL
          FILES^=*|TXT|INI|CLB|CTB|DAT};
          %plus%=^?{SUBFOLDERS?==INCLUDE^=+|_EXCLUDE^=^%empty%};
          %select%=^?{AUTOSELECT FILES?==YES^=_|_NO^=^%empty%}
          ;
          ^!SetListDelimiter |^%select%
          ^!Set %filelist%=^$GetFiles("^%plus%^%defpath%";*.^%ext%;type)$
          ^!Set %filelist%=^$StrReplace("^%defpath%";^%empty%;"^%filelist%";0;0)$
          ^!SetArray %filelist%=^?{(H=24;T=A) FILES WITH ENTERED ATTRIBS -- No
          choice quits==^%select%^%filelist%}
          ;
          ^!If ^%filelist%=^%empty% END
          :TASK
          ^!Menu File/New
          ^!SetScreenUpdate 0
          ^!Save AS "^$GetDocumentPath$Multi-File text.txt"
          ^!Set %count%=^%filelist0%; %index%=0
          :NEXTTASK
          ^!Inc %index%
          ^!If ^%index% > ^%count% END
          ^!Set %filetext%=^$GetFileText("^%defpath%^%filelist^%index%%")$
          ^!Set %filename%=^%defpath%^$GetFileName("^%filelist^%index%%")$
          ;
          ;^!Info "^%defpath%^%filelist^%index%%"
          ^!InsertText ^$StrTrim("^%filetext%")$
          ^!InsertText ^%nl%^$StrFill(_;5)$TEXT FROM
          ^%filename%^$StrFill(_;5)$^%nl%^%nl%
          ;
          ^!Jump TEXT_END
          ^!Goto NEXTTASK
          :END
          --- select from beginning marker to the above :END label, paste into a
          new document
          --- add to clipbook of your choice.
        Your message has been successfully submitted and would be delivered to recipients shortly.