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

Re: [Clip] Convert Outline to text file

Expand Messages
  • Dick Gascoigne
    Hi, everyone - Thanks Jim, Jody, Melchior and HSavage for all your good suggestions. The Insert File works best for me - I hadn t even thought of it until
    Message 1 of 6 , Aug 3 2:52 AM
    • 0 Attachment
      Hi, everyone -
      Thanks Jim, Jody, Melchior and HSavage for all your good suggestions.

      The Insert File works best for me - I hadn't even thought of it until
      reading Melchior's message.

      Before I saw HSavage's clip I had written a quick and dirty one to do
      somewhat the same. But I like yours better :-)

      If anyone is interested, the document starts out as a computer program with
      many subroutines - all in one several-thousand line text file. I run a clip
      that finds each subroutine name, and pastes an "^PH=<name>" line above it,
      then saves the file as an .otl.

      That makes it easy to jump back and forth between the subroutines to follow
      the Call's. But, after making changes to the code, I needed to strip out the
      H= lines to get back to the original form. Now I can !

      Works slick now. Thanks again.

      Dick in Singapore

      ----- Original Message -----
      From: "hsavage" <hsavage@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: Monday, 02 August, 2004 5:36 AM
      Subject: Re: [Clip] Convert Outline to text file

      > > Dick Gascoigne wrote:
      > > How do I remove all of the =H lines in an outline document,
      > > to convert back to a plain text file?
      > >
      > > I have a clip that adds headings to a multi-section document,
      > > saves it as a .otl, and re-opens. The result is a very nicely
      > > outlined document, so that I can find and edit different sections.
      > >
      > > But now I want to remove all the headings, so as to get back
      > > to a plain text file.
      > >
      > > While in the OTL document, I can't search on "H=" lines.
      > > If I use Remove Header it also removes all the contents (of course).
      > > If I save it as a .txt, and re-open, it still opens as an outline.
      > >
      > > I guess I could write a clip to go to each topic, and Append
      > > To File the contents, but that isn't very "elegant". ;-)
      > >
      > > Dick Gascoigne
      > > Singapore
      > Dick,
      > This is a short clip to do what you want.
      > It will load the file text from any outline you select into a new file,
      > delete the first line, find all lines that begin with H= and delete the
      > H= leaving the rest of the title as a section label.
      > It then saves the otl text as a text file, in the \outlines\ folder,
      > using the same filename as the otl file, eg., 'test.otl' will be saved
      > as 'test.txt' leaving the otl file intact for you to keep or dispose of
      > later.
      > When pasting it into a clip ensure the single long line is rejoined, it
      > will probably be split by the email program. The long line is separated
      > above and below with a blank comment line beginning with a lone
      > In writing I assumed you outline files were in the NoteTab \outlines\
      > folder.
      > H="Otl2Text"
      > ^!ClearVariables
      > ^!SetDebug 1
      > ^!SetScreenUpdate 0
      > ;
      > ^!Set %otl2edit%=^?{(T=O;F="OTL FILE|*.otl")Select Otl To Convert To
      > Text=^$GetAppPath$Outlines\}
      > ;
      > ^!SetCode %otl%=^$GetFileText("^%otl2edit%")$
      > ^!Menu File/New
      > ^!InsertCode ^%otl%
      > ^!Jump 1
      > ^!Find ^\=\sV4 TIRS
      > ^!IfError EXIT
      > ^!DeleteLine
      > ^!Replace "^h\=" >> "" TIRSA
      > ^!Save AS ^$GetAppPath$Outlines\^$GetName(^%otl2edit%)$.txt
      > Yahoo! Groups Links
    Your message has been successfully submitted and would be delivered to recipients shortly.