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

Re: [Clip] FW: Query on OTL docs to txt

Expand Messages
  • Alan C.
    Hi John and everyone, ... Here s a possible prototype. The clip works reliably. At least for my own personal approach. But others have rights too. What I
    Message 1 of 8 , May 29, 2001
    • 0 Attachment
      Hi John and everyone,

      > >create individual txt files from an outline, that is, test.otl consisting
      >of
      > >five headings--A, B, C, D, E--to be made into five individual A.txt. B.txt,
      > >etc. files.
      >
      >Yes you can; I missed a word when reading your last post. Yes, with the
      >scripting language you can. I will try to find time later on to write the
      >script for you. You can also sign up for my Clips list and ask somebody
      >there.
      >
      >http://groups.yahoo.com/group/ntb-clips

      Here's a possible prototype. The clip works reliably. At least for my own personal approach. But others have rights too.

      What I speak of here is the need to use another editor, say Notepad, to delete the very top (header line) that defines to Ntab that it is an Ntab outline.

      Then save as, save a copy of the outline as a text file.

      So, no more main header and no more .otl file extension, but an .txt extension instead. Then, open this "modified" outline file in Ntab; it will now no longer open as an outline but will open as a doc. Focus it. Be sure to click/place cursor just slightly above the first H= (first topic to get). Then run the following clip.

      I used a Ntab with no docs other than the 1 focused file open. I tested it on readme.otl (9 topics I think) and it worked reliably. But it has a couple minor bugs. 1. didn't get the very last topic of readme.otl 2. 2 blank/empty docs at the end of the clip's run.

      the clip leaves 8 or 9 text files open in Ntab, each with an otl topic except for the last 2 empty files.

      As it is now, the clip would serve my need since I don't too often need convert an outline in such manner.

      But I thought I'd toss it out there to see what others thought. And maybe it is something simple as to the bugs. Clip follows.

      H="OTL ea topic to text"
      ; 1st delete OTL header so can open the OTL in Ntab as doc
      ; then place cursor above 1st "H=" then launch this clip
      ; This clip then makes ea OTL topic into an
      ; individual text file
      ^!ClearVariables
      ; ^!Set %begin%=^$GetRow$
      ^!Set %cnt%=0
      :loop
      ^!Find "^pH=" SIT
      ^!IfError skip_5
      ^!Set %row%=^$GetRow$
      ^!Append %rowlist%=^%row%:1^%NL%
      ^!IfSame "^%cnt%" "10" premak
      ^!Inc %cnt%
      ^!Goto loop

      ^!If ^%cnt% < 9 lastpar

      :premak
      ^!SetListDelimiter ^p
      ^!SetArray %RowAray%=^%rowlist%
      ^!Set %sorcidx%=^$GetDocIndex$
      ; ^!SetCursor ^%begin%:1
      ^!Set %index%=1
      :makfil
      ^!SetCursor ^%RowAray^%index%%
      ^!Inc %index%
      ^!SelectTo ^%RowAray^%index%%
      ^!Set %ea_doc%=^$GetSelection$
      ^!Toolbar "New Document"
      ^!InsertText ^%ea_doc%
      ^!SetDocIndex ^%sorcidx%
      ^!If ^%index% > ^%RowAray0% end
      ^!Goto makfil
      :lastpar
      ^!Jump TEXT_END
      ^!Set %row%=^$GetRow$; %col%=^$GetCol$
      ^!Append %rowlist%=^%row%:^%col%
      ^!Goto premak
      ;----<end of clip<<

      Alan.
    • Ray Shapp
      John, Alan C. An easy way to open an outline as a text file is to create a new file in NTab then click Document | Insert File... and browse to the outline you
      Message 2 of 8 , May 30, 2001
      • 0 Attachment
        John, Alan C.

        An easy way to open an outline as a text file is to create a new file in
        NTab then
        click Document | Insert File... and browse to the outline you want to open.
        Jody gave me this tip only a week or so ago in connection with a different
        question I asked. This gives me an opportunity to give something back to
        the group.

        HTH,

        Ray Shapp
        Watchung, NJ
      • Alan C.
        Hi Ray, ... Thanks for volunteering that tip there; it hit the spot for me anyway. I just did as per your tip and then ran my otl ea topic to text conversion
        Message 3 of 8 , May 30, 2001
        • 0 Attachment
          Hi Ray,

          >An easy way to open an outline as a text file is to create a new file in
          >NTab then <snipped>

          Thanks for volunteering that tip there; it hit the spot for me anyway.

          I just did as per your tip and then ran my "otl ea topic to text" conversion clip on it. That's a great method, ie run my clip on a temporary doc such as that. Dispose of the temporary doc when done. And, no changes were made to the original outline.

          Additionaly:

          I improved my clip. I updated the clip's following line. The 2nd line there is the new and correct line.

          ; ^!If ^%cnt% < 9 lastpar
          ^!If ^%cnt% =< 9 lastpar

          With the above improvement, the/my clip now gets *all 9* of readme.otl topics, each topic into its own separate text file document. Also the clip now only leaves a tenth (a blank doc after the ninth readme.otl topic) which is just one instead of two blank/empty docs.

          I'll further develop this clip given some time. The clip, not yet, but it could also: 1. save each of the newly created files with its own filename. 2. the number of topics processed at each chunk could be raised from ten to fifteen or twenty or so. See, I observed potential that, on a large outline say with 40 topics, ability already exists to go back to the source doc and begin (launch/run clip) again at the cursor position where it had left off at on its previous chunk of topics.

          havin some fun and hope you are too. :-)
          Alan.
        • Manuel
          In this time is very important the security via email I test the library utilities, exactly clip encriptytion y decryption. I select text and write a pasword.
          Message 4 of 8 , May 30, 2001
          • 0 Attachment
            In this time is very important the security via email

            I test the library utilities, exactly clip encriptytion y decryption.
            I select text and write a pasword.

            But It's secure this?


            ---
            manuel123@...
            Cursos para ciegos (Courses for blind people)
            Windows,Iexplorer,Outlook,Html,Word,Excel,Access
            http://manuel123.8m.com (en espaƱol)
            http://infoman.8m.com (english page)
          • Ray Shapp
            Alan, Credit goes to Jody for the import-document-on-an-outline tip. I m glad it was of some help to you. I m havin a great time, thank you. Ray Shapp
            Message 5 of 8 , May 31, 2001
            • 0 Attachment
              Alan,

              Credit goes to Jody for the import-document-on-an-outline tip. I'm glad it
              was of some help to you.

              I'm havin' a great time, thank you.

              Ray Shapp
              Watchung, NJ
            • Jody
              Hi Manuel, ... In short, You should not rely on this feature to protect very sensitive data. * Added ^$StrEncrypt(Text[;Key])$ and ^$StrDecrypt(Text[;Key])$
              Message 6 of 8 , May 31, 2001
              • 0 Attachment
                Hi Manuel,

                >In this time is very important the security via email
                >
                >I test the library utilities, exactly clip encriptytion y decryption.
                >I select text and write a pasword.
                >
                >But It's secure this?

                In short, "You should not rely on this feature to protect very
                sensitive data."

                * Added ^$StrEncrypt(Text[;Key])$ and ^$StrDecrypt(Text[;Key])$
                functions, which provide stronger text encryption than ROT13. Use
                the optional Key parameter to define an encryption password (max.
                255 characters). Note that the encryption algorithm is relatively
                simple and does not offer absolute security. You should not rely
                on this feature to protect very sensitive data.

                ^$StrROT13("Str")$ (added in v4.84)
                Performs a ROT13 operation on the specified text. Useful for
                rendering text unreadable to others. Repeat the function on the
                text to render it readable again.

                ^$StrEncrypt("Text";[Key])$ (added in v4.84)
                Provides stronger text encryption than ROT13. Use the optional
                "Key" parameter to define an encryption password (maximum 255
                characters and case sensitive). Make sure you don't forget the
                key you used with this function, otherwise you may never be able
                to retrieve your encrypted text. Note that although the
                encryption algorithm is very good, there is no guarantee that it
                can't be cracked. You should not rely on it to protect very
                sensitive data. Example:

                ^$StrEncrypt("^$GetSelection$";"^?[key=My secret password]")$


                ^!UUEncode "InputName"[ "OutputName"] (added in v4.84) InputName
                is the file to encode. Use the optional OutputName to define the
                name of the UUEncoded data file. If you don't specify an output
                name, the name will be based on InputName with the extension
                ".uue".

                ^!UUDecode "InputName"[ "OutputName"] (added in v4.84)
                InputName is the file to decode. Use the optional OutputName to
                define the name of the UUEncoded data file. If you don't specify
                an output name, the name stored in the encoded file will be used.

                ^!FileScramble "InputName"[ "OutputName"[ "Key"]] (added in
                v4.84) encrypts and decrypts files. This command can
                automatically detect if the file needs encrypting or decrypting.
                InputName is the file to encrypt or decrypt. Use the optional
                OutputName to define the name of the file created by the
                operation. If the file is going to be encrypted and you don't
                specify an output name, the name will be based on InputName with
                the extension ".npw". If the file is going to be decrypted and
                you don't specify an output name, the original file name will be
                used. Use the optional "Key" parameter to define an encryption
                password (max. 255 characters). Make sure you don't forget your
                password, or you will not be able to restore your encrypted data.

                The encryption algorithm is based on RC4 ("RC4" is a trademark of
                RSA security corporation). You should not rely on this feature to
                protect very sensitive data.

                Happy Clip'n!
                Jody

                http://www.notetab.net

                Subscribe, UnSubscribe, Options
                mailto:Ntb-Clips-Subscribe@yahoogroups.com
                mailto:Ntb-Clips-UnSubscribe@yahoogroups.com
                http://www.egroups.com/group/ntb-clips
              • Alan C.
                Hi, The clip with more improvements file prefix ~tt stands for topic to text AND hopes that because of such unique filename that you ll NOT overwrite an
                Message 7 of 8 , May 31, 2001
                • 0 Attachment
                  Hi,

                  The clip with more improvements

                  file prefix ~tt stands for "topic to text" AND hopes that because of such unique filename that you'll NOT overwrite an existing file in your Ntab documents directory. (textofile command overwrites an previously existing file of the SAME name). So, as each of the newly generated filenames, you have ~tt"topic".txt (without the quotes).

                  Does/creates correct number of files now while now it no longer creates any extra blank file.

                  takes a chunk of ten (or less if it is a small outline) topics at a time, ea topic saved into its own text file.

                  On larger outline can do 1st ten topics then go back and begin again at the 11th topic in your outline to get more or get all topics.

                  The strreplace lines exist because I had an outline with some topics that had characters which are considered illegal or not to be used in filenames (the clip names each file with its topic name ie topic.txt).

                  The 2nd texttofile line if perchance an filename illegal character then, rather than totally skip and not make that file, instead you get a perfectly fine file with a ~beep~ inserted in the filename. (an error will show if that is the case if so just click ok on the io error dialog during processing and continue)

                  Enjoy, modify to suit, etc. If anybody has a modification request on it, I may be able to do it.

                  2 texttofile lines are the only long lines.

                  H="OTL ea topic to text"
                  ; 1st, need to open the outline as a text file: create a
                  ; new file in NTab then click Document | Insert File...and
                  ; browse to the outline you want to open. Then in your
                  ; inserted file, place cursor above 1st "H=" then launch
                  ; this clip which then makes ea OTL topic into an
                  ; individual text file
                  ^!ClearVariables
                  ^!Set %cnt%=0
                  :loop
                  ^!Find "^pH=" SIT
                  ^!IfError fwd
                  ^!Delay 2
                  ^!Set %row%=^$GetRow$
                  ^!Append %rowlist%=^%row%:1^%NL%
                  ^!Jump SELECT_END
                  ^!Select EOL
                  ^!Set %hdr%=^$GetSelection$
                  ^!Set %hdr%=^$StrReplace(\;_;^%hdr%;False;False)$
                  ^!Set %hdr%=^$StrReplace(/;_;^%hdr%;False;False)$
                  ^!Set %hdr%=^$StrReplace(:;_;^%hdr%;False;False)$
                  ^!Append %namList%=^%hdr%;
                  ^!IfSame "^%cnt%" "10" premak
                  ^!Inc %cnt%
                  ^!Goto loop
                  :fwd

                  ^!If ^%cnt% =< 9 lastpar

                  :premak
                  ^!SetArray %namList%=^%namList%
                  ^!SetListDelimiter ^p
                  ^!SetArray %RowAray%=^%rowlist%
                  ^!Set %index%=1; %fIdx%=0
                  :makfil
                  ^!SetCursor ^%RowAray^%index%%
                  ^!Inc %index%
                  ^!SelectTo ^%RowAray^%index%%
                  ^!Set %ea_doc%=^$GetSelection$
                  ^!Inc %fIdx%
                  ^!TextToFile "^$GetDocumentPath$~tt^%namList^%fIdx%%.txt" ^%ea_doc%
                  ^!IfError skip
                  ^!Goto skip
                  ^!TextToFile "^$GetDocumentPath$~t^%fIdx%~beep~.txt" ^%ea_doc%
                  ^!If ^%index% >= ^%RowAray0% end
                  ^!Goto makfil
                  :lastpar
                  ^!Jump TEXT_END
                  ^!Set %row%=^$GetRow$; %col%=^$GetCol$
                  ^!Append %rowlist%=^%row%:^%col%
                  ^!Goto premak
                  ; ---<end of clip<<

                  Regards. Alan.
                • Eric G.V. Fookes
                  Hi Jody and Manuel, ... Yes, I did include that warning in my documentation. I did so mainly to protect myself in case some sensitive data encrypted through
                  Message 8 of 8 , Jun 1, 2001
                  • 0 Attachment
                    Hi Jody and Manuel,

                    > >In this time is very important the security via email
                    > >
                    > >I test the library utilities, exactly clip encriptytion y decryption.
                    > >I select text and write a pasword.
                    > >
                    > >But It's secure this?
                    >
                    >In short, "You should not rely on this feature to protect very
                    >sensitive data."

                    Yes, I did include that warning in my documentation. I did so mainly to
                    protect myself in case some sensitive data encrypted through NoteTab was
                    cracked. NoteTab is used by quite a few large organizations and companies
                    (including the US government and the secret service of several countries).
                    I wouldn't want them to rely on NoteTab to keep extremely sensitive data
                    safe from prying eyes.

                    However, unless you are under investigation by some state agency or of
                    prime interest to large groups of expert crackers, you can consider the
                    encryption as very secure. The algorithm is based on RC4.

                    Regards,
                    Eric G.V. Fookes
                    Author of NoteTab, Mailbag Assistant, and Album Express
                    http://www.fookes.com/ and http://www.notetab.com/







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