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

Re: otl to txt

Expand Messages
  • Sheri
    Hi Michael, I think this will do what you want. The text files will be saved in the same location as the otl file. Regards, Sheri ... ^!IfDiff
    Message 1 of 12 , Jan 22, 2007
    View Source
    • 0 Attachment
      Hi Michael,

      I think this will do what you want. The text files will be saved in
      the same location as the otl file.

      Regards,
      Sheri

      :Top
      ^!IfDiff "^$GetExt(^$GetDocName$)$" ".otl" Next Else Start
      ;next is one long line
      ^!Set %otlname%="^?{(T=O;F="Outline Files (*.otl)|*.otl")Open outline
      file=^%otlname%}"
      ;end long line
      ^!Open "^%otlname%"
      ^!Goto Top
      :Start
      ^!Set %otlname%="^$GetDocName$"
      ^!Set %savepath%="^$GetPath("^%otlname%")$"
      ^!IfTrue ^$IsModified$ Error
      ^!ShowHeadings True
      ^!Set %tottopics%=^$GetTopicCount$
      ^!Set %topind%=0
      ^!Setscreenupdate off
      :Loop
      ^!Inc %topind%
      ^!If ^%topind%>^%tottopics% Out
      ^!SetTopicIndex ^%topind%
      ;next is one long line
      ^!Set %zeros%=^$Calc(^$StrSize("^%tottopics%")$-^$StrSize("^%topind%")$)$
      ;end long line
      ^!Set %savename%="^$StrFill("0";^%zeros%)$^%topind%"
      ^!TexttoFile "^%savepath%^%savename%.txt" ^$GetText$
      ^!Goto Loop
      :Error
      ^!Prompt Please save the file before using this clip.
      ^!Goto end
      :Out
      ^!Prompt All done
      ;end of clip
    • tiptoebasoon
      Thanks Sheri! You made my day. With your clip I extracted an otl with 323 headings to 323 text files, perfectly -- even the headings I use as topic separators
      Message 2 of 12 , Jan 22, 2007
      View Source
      • 0 Attachment
        Thanks Sheri!

        You made my day. With your clip I extracted an otl with 323 headings to
        323 text files, perfectly -- even the headings I use as topic
        separators consisting of a single space with no content came through as
        text files, which is just what I wanted. So heaps of anonymous thanks!

        --Michael
      • Corl DeLuna
        Hi, I need to count the number of highlighted lines, Right now, I select the lines, go to Find and Replace, type ^P in Find What:, select Count Occurrences,
        Message 3 of 12 , Jan 23, 2007
        View Source
        • 0 Attachment
          Hi,

          I need to count the number of highlighted lines, Right now, I select the
          lines, go to Find and Replace, type ^P in Find What:, select Count
          Occurrences, and click count get get my answer. Not a lot of steps, but I'm
          doing this all the time.

          Does anyone know of a clip that will do this for me?

          Thanks,
          Corl


          [Non-text portions of this message have been removed]
        • Sheri
          ... You can count newlines using ^$StrCount. Try this: ;next is one long line ^!Info Highlighted Line Count: ^$StrCount( ^%NL% ; ^$GetSelection$ ;No;No)$ ;end
          Message 4 of 12 , Jan 23, 2007
          View Source
          • 0 Attachment
            --- In ntb-clips@yahoogroups.com, "Corl DeLuna" <corl@...> wrote:
            > Hi,
            >
            > I need to count the number of highlighted lines, Right
            > now, I select the lines, go to Find and Replace, type
            >
            > in Find What:, select Count Occurrences, and click
            > count get get my answer. Not a lot of steps, but I'm
            > doing this all the time.
            >
            > Does anyone know of a clip that will do this for me?
            >
            > Thanks, Corl

            You can count newlines using ^$StrCount.

            Try this:

            ;next is one long line
            ^!Info Highlighted Line Count:
            ^$StrCount("^%NL%";"^$GetSelection$";No;No)$
            ;end long line
            ;end of clip
          • Corl DeLuna
            Hi Sheri, I get the dialogue Line Count, that says, Highlighted Line Count: I press OK and it overwrites all the highlighted lines with the correct line number
            Message 5 of 12 , Jan 23, 2007
            View Source
            • 0 Attachment
              Hi Sheri,

              I get the dialogue Line Count, that says, Highlighted Line Count: I press OK
              and it overwrites all the highlighted lines with the correct line number
              count.

              I'm assuming that the numerical count should have been displayed in the Line
              Count box, and the lines be left alone.

              Thank you for your help,
              Corl

              _____

              From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf
              Of Sheri
              Sent: Tuesday, January 23, 2007 1:48 PM
              To: ntb-clips@yahoogroups.com
              Subject: [Clip] Re: Countings Lines



              --- In ntb-clips@yahoogrou <mailto:ntb-clips%40yahoogroups.com> ps.com,
              "Corl DeLuna" <corl@...> wrote:
              > Hi,
              >
              > I need to count the number of highlighted lines, Right
              > now, I select the lines, go to Find and Replace, type
              >
              > in Find What:, select Count Occurrences, and click
              > count get get my answer. Not a lot of steps, but I'm
              > doing this all the time.
              >
              > Does anyone know of a clip that will do this for me?
              >
              > Thanks, Corl

              You can count newlines using ^$StrCount.

              Try this:

              ;next is one long line
              ^!Info Highlighted Line Count:
              ^$StrCount("^%NL%";"^$GetSelection$";No;No)$
              ;end long line
              ;end of clip






              [Non-text portions of this message have been removed]
            • Sheri
              Corl, the clip should be on one line, as indicated in its comments. Yahoo has broken it into two. Regards, Sheri
              Message 6 of 12 , Jan 23, 2007
              View Source
              • 0 Attachment
                Corl, the clip should be on one line, as indicated in its comments.
                Yahoo has broken it into two.

                Regards,
                Sheri

                --- In ntb-clips@yahoogroups.com, "Corl DeLuna" <corl@...> wrote:
                >
                > Hi Sheri,
                >
                > I get the dialogue Line Count, that says, Highlighted
                > Line Count: I press OK and it overwrites all the
                > highlighted lines with the correct line number count.
                >
                > I'm assuming that the numerical count should have been
                > displayed in the Line Count box, and the lines be left
                > alone.
                >
                > Thank you for your help, Corl
                >
              • Corl DeLuna
                Thank you very much Sheri. It works like a charm as one whole string. Best, Corl _____ From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On
                Message 7 of 12 , Jan 23, 2007
                View Source
                • 0 Attachment
                  Thank you very much Sheri. It works like a charm as one whole string.

                  Best,
                  Corl


                  _____

                  From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf
                  Of Sheri
                  Sent: Tuesday, January 23, 2007 4:19 PM
                  To: ntb-clips@yahoogroups.com
                  Subject: [Clip] Re: Countings Lines



                  Corl, the clip should be on one line, as indicated in its comments.
                  Yahoo has broken it into two.

                  Regards,
                  Sheri

                  --- In ntb-clips@yahoogrou <mailto:ntb-clips%40yahoogroups.com> ps.com,
                  "Corl DeLuna" <corl@...> wrote:
                  >
                  > Hi Sheri,
                  >
                  > I get the dialogue Line Count, that says, Highlighted
                  > Line Count: I press OK and it overwrites all the
                  > highlighted lines with the correct line number count.
                  >
                  > I'm assuming that the numerical count should have been
                  > displayed in the Line Count box, and the lines be left
                  > alone.
                  >
                  > Thank you for your help, Corl
                  >






                  [Non-text portions of this message have been removed]
                Your message has been successfully submitted and would be delivered to recipients shortly.