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

3102Re: [NTB] Re: Converting .txt files into .otl

Expand Messages
  • Jody
    Apr 3, 2000
      Hi Paul K. and All,

      Paul, I hope you did not work too hard converting your .txt files
      to an Outline. Which this the main thing you want to do it check
      for long lines in the script and just put the *.txt files you
      want to append in a folder by themselves. You may have other
      file types in that folder if you wish, but all the *.txt files
      will be put in the Outline.

      The Clip below appends a whole directory of files to an Outline
      you specify. It will create a new Outline if it does not exist.
      You can use file filters with wildcards such as *.txt and even
      append Outlines to an existing or new Outline. I shortened this
      up as much as possible. I will upload a better version and also
      one that brings up a checkbox list to choose files to add to an
      Outline or make a new one. They are already done, but I am think
      on merging the OutLine Tools Clip into them to strip HTML and =
      V4 Outline headers automatically when those file types are added
      to an Outline. This version did 1675 small files in about 12
      "Turkey n's" on my 350 with 64MB RAM. ;)

      There are a few long lines. Turn Word Wrap off in the [Clips]
      Editor and make sure there is no black text. If so, that means
      the lines got split. Join them manually; do not use Join Lines.

      <--- Copy below this line --->
      H=Files To Outline...
      ; Last Updated 04/03/2000, Sojourner@..., jody
      ; Requires NoteTab version 4.8 or above
      ; http://www.sureword.com/notetab

      :ReStart
      ^!ClearVariables

      ^!SetWizardTitle Creates an Outline from a directory of files...
      ^!SetWizardLabel You've seen it before... ;) Happy Outlin'n

      ; long line up to blank line
      ^!Set %Folder%=^?{(T=D)Browse to direextory or enter path, end in backslash}; %Type%=^?{(H=10)File &Types, wildcards OK: *.txt or *.*htm*;*.txt=*.txt}; %Sort%=^?{Sorting method=Unsorted|_Name|Type|Date|Size}; %Rev%=^?{Reverse sorting=_No^=|Yes^=Rev}; %OutLine%=^?{(T=S;F="Outline Files|*.otl")Save Outline as (..\Path\Filename.otl)=^$GetDocumentPath$}

      ^!SetHintInfo Appending files to ^%OutLine%
      ^!SetScreenUpdate Off

      ^!IfFileExist "^%OutLine%" Skip
      ^!AppendToFile "^%OutLine%" = V4 Outline MultiLine NoSorting TabWidth=30^%nl%^%nl%

      ^!SetArray %List%=^$GetFiles(^%Folder%;^%Type%;^%Rev%^%Sort%)$
      ^!IfTrue ^$IsEmpty("^%List%")$ Error
      ^!Set %Count%=^%List0%
      ^!Set %Index%=0

      :Loop
      ^!Inc %Index%
      ^!If ^%Index% > ^%Count% Open
      ^!Set %Heading%=^$GetName("^%List^%Index%%")$
      ^!AppendToFile "^%OutLine%" ^%nl%^%nl%H=^%Heading%^%nl%^$GetFileText("^%List^%Index%%")$
      ^!Goto Loop

      :Open
      ^!Open "^%OutLine%"
      ^!Goto End

      :Error
      ; long line... ^!Goto starts next line
      ^!Skip There were no files by the file type you search for^%nl%(^%Type%) in ^%Folder% or you did not enter an^%nl%Outline path and file to make. Try again?
      ^!Goto End
      ^!Goto ReStart

      <--- Copy above this line, right --->
      <--- click over a Library, and --->
      <--- choose "Add from Clipboard" --->

      Happy Clip'n!
      Jody

      http://www.sureword.com/notetab

      Subscribe, UnSubscribe, Options
      mailto:Ntb-Clips-Subscribe@...
      mailto:Ntb-Clips-UnSubscribe@...
      http://www.egroups.com/list/ntb-clips