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

Clip program to edit a list according to certain criteria

Expand Messages
  • frankrazer
    Hi, I am new to clip programing... I need to search and then edit a list according to certain criteria: 1. Delete all strings (paragraphs)that are 25
    Message 1 of 3 , Jul 31, 2005
    • 0 Attachment
      Hi,

      I am new to clip programing...

      I need to search and then edit a list according to certain criteria:

      1. Delete all strings (paragraphs)that are >25 characters in length
      including spaces and then delete them...

      example:

      aaaaa aaaaa aaaaaaaaaa aaa (Keep, 25 characters long)
      aaaaa aaaaa aaaaaaaaaa aaaa (Delete, 26 characters long)

      ****Not including any spaces at the end of a string on each line

      2. Search and delete all paragraphs with any numbers in them

      3. Search and delete all paragraphs with any Punctuation in them

      4. Compare every paragraph(ie. every word)in the document to
      another
      list of words and if any matches are found to replace with a string
      of
      asterisks....case does not matter

      Please could you suggest which commands I need and how to repeat the
      commands to act on the document

      I intend to write a separate clip for each of the above criteria

      Regards


      Frank
    • Alec Burgess
      Frank: Its best to reply to the list most times. Others can contribute or learn or both as appropriate :-) ... I might have misunderstood your original specs -
      Message 2 of 3 , Aug 1, 2005
      • 0 Attachment
        Frank:
        Its best to reply to the list most times. Others can contribute or learn or
        both as appropriate :-)

        Jody (see below re clipclass.zip):

        > In the code below that you wrote for replacing:
        >
        > ; 1-any run of paragraphs with more than 25 chars
        >
        > ^!replace "^(..........................+\s*\n)+" >> ""
        > rwsait
        >
        > I understand the wrapper... "(--something--\n)+"
        >
        > However what is the +\s parameter doing?

        I might have misunderstood your original specs - I thought you wanted spaces
        at the end of the line to not be counted. In fact looking at it now its
        completely superfluous :-( It matches zero or more spaces and whether
        present or not makes no difference - lines longer than 25 chars will still
        be deleted.

        >
        > Also in
        >
        > ^!replace "^(.*[0-9].*\n)+" >> "" rwsait
        >
        > ^!replace "^(.*^%anyPunct%.*\n)+" >> "" rwsait
        >
        > Are the two asterisks and ^ enclosing the variable so
        > that it can be acted on by another command (i.e. Replace)?

        No. the centre match is to any digit or any punction character, but we need
        to get the entire line (or lines if they occur one after each other) matched
        so they can be replaced by "" ie. nothing.

        So the leading and trailing .* match anything or nothing before and then
        after the key match. If they weren't present (and you still had the leading
        ^ which ties the match to the beginning of a line) we'd be trying to match a
        single digit or punctuation on a line by itself.

        >
        > Also please could you point to a resource suitable for
        > beginners like me

        Jody wrote a "clipclass" which contains about ten lessons which gently
        introduce you to clipwriting concepts and practices.

        He said this back in Dec 2001 - isn't google wonderful :-) :
        >> If you are speaking of Clips in general, the read Clip Basics and
        Clip Language - Introduction in Help. The are some short
        information in my Clip Class that goes over making a Library
        (which you should learn first, making a new Clip, and editing a
        Clip. Without you posting some of what you have already we can
        only give you help in a general way.

        You can download my Clip Class from the following link and it
        will walk you through, Getting Started (which is a web page with
        a number of images displaying different parts of NoteTab that
        deals with Clipbooks), making a Library, adding Clips, and
        editing Clips, on to more difficult Clips. Be sure to read the
        Introduction also. Open ClipClass.clb and then click on the
        ClipClass Outline Clip to open the Outline.

        All the contents of the zip files go in NoteTab's Libraries folder.
        http://www.notetab.net/clipclass/clipclass.zip

        The NoteTab ClipClass List
        mailto:ntb-ClipClass-Subscribe@yahoogroups.com
        <<

        I know that the clipclass list itself has been closed but the clipclass.zip
        should still be available somewhere (the URL above gives a 404). I was
        hoping he might have put a copy in
        http://groups.yahoo.com/group/ntb-clips/files/ (the files archive for this
        group) but perhaps it is too big to fit. Hopefully Jody will chime in with
        its current location but there are some other things there you might find
        worthy of study.

        > that gives me sample code on how each
        > command works and tells me the full paramaters on how a
        > command can act on variables that you set

        The best documentation is the cliphelp that you already have. Note that
        every clip command can be found in its index. eg. enter ^$str and you will
        be shown all the clip fuctions. I wind up going to it for almost every clip
        I write, and often just copy the syntax from it to my clip and substitute
        required parameters.

        Regards ... Alec
        --
        ; ( ) { } [ ] \ | 9 0 + = () {} []


        ---- Original Message ----
        From: "frankrazer" <frankrazer@...>
        To: "Alec Burgess" <buralex@...>
        Sent: Monday, August 01, 2005 08:26
        Subject: [gla: Re: Clip program to edit a list according to
        certain criteria

        > Hi Alec,
        >
        > Many Thanks for the clip code and for making my life
        > infinitely easier :-)
        >
        > I've just tested it out on my data and it works
        > perfectly:-)
        >
        > Below is my first effort code for replacing:
        > 1. punctuation
        > 2. Digits
        >
        >
        > 1.
        > //The program replaces each Punctuation mark with a
        > //"###"
        >
        >> repeat
        > ^!Replace "[!":;'@.,?/\~&%$£+]" >> "###" RW
        > ^!IfError End
        > ^!Goto repeat
        >
        > 2.
        > //The program replaces each Number mark with a //"***"
        >
        >> repeat
        > ^!Replace "[0-9]" >> "***" RW
        > ^!IfError End
        > ^!Goto repeat
        >
        > Very crude I think and not very good:-(
        >
        > Just a couple of questions
        >
        >
        > Again...
        > Many thanks...You don't know how much time you have saved
        > me:-)
        >
        > Regards,
      • Jody
        Hi Alec and Others, ... This is the updated information. (The name of the ClipClass files was changed a number of years ago to Clip Tutorial (ClipTut).) The
        Message 3 of 3 , Aug 2, 2005
        • 0 Attachment
          Hi Alec and Others,

          >> Also please could you point to a resource suitable for
          >> beginners like me
          >
          >Jody wrote a "clipclass" which contains about ten lessons which
          >gently introduce you to clipwriting concepts and practices.
          >
          >He said this back in Dec 2001 - isn't google wonderful :-) :
          >>> If you are speaking of Clips in general, the read Clip Basics
          >>> and Clip Language - Introduction in Help. The are some short
          >>> information in my Clip Class that goes over making a Library
          >>> (which you should learn first, making a new Clip, and editing
          >>> a Clip. Without you posting some of what you have already we
          >>> can only give you help in a general way.
          >
          >You can download my Clip Class from the following link and it
          >will walk you through, Getting Started... <snip>
          >
          >> All the contents of the zip files go in NoteTab's Libraries folder.
          >> http://www.notetab.net/clipclass/clipclass.zip

          This is the updated information. (The name of the ClipClass files
          was changed a number of years ago to Clip Tutorial (ClipTut).)

          The following is a download for a Clipbook programming tutorial
          designed to walk you through Clip writing. It includes "Getting
          Started" (which is a web page with a number of images displaying
          different parts of NoteTab that deals with Clipbooks), making a
          Clipbook Library, adding Clips, and editing Clips, on to more
          difficult Clip writing. Be sure to read the Introduction also.
          Open ClipTut.clb and then click on the ClipTut.otl Outline Clip
          to open the Outline.

          All the contents of the zip files go in NoteTab's Libraries
          folder. http://www.notetab.net/zip/cliptut.zip

          You can also sign up for the NoteTab Clips List to get answers to
          Clip questions, but please do not post there concerning the
          tutorial. NoteTab Clips Subscribe & Edit Options:

          Subscribe, unSubscribe, Options
          mailto:ntb-Clips-Subscribe@yahoogroups.com
          mailto:ntb-Clips-unSubscribe@yahoogroups.com
          http://groups.yahoo.com/group/ntb-clips

          Happy Clip'n! Jody

          http://www.notetab.net http://www.notetab.net/html/cd-info.htm
          http://www.fookes.com/regnow.html?2448&item=home

          >> The NoteTab ClipClass List
          >> mailto:ntb-ClipClass-Subscribe@yahoogroups.com
          >
          >I know that the clipclass list itself has been closed but the clipclass.zip
          >should still be available somewhere (the URL above gives a 404). I was
          >hoping he might have put a copy in
          >http://groups.yahoo.com/group/ntb-clips/files/ (the files archive for this
          >group) but perhaps it is too big to fit. Hopefully Jody will chime in with
          >its current location but there are some other things there you might find
          >worthy of study.

          Actually, it is in ntb-tutorials (I think), but called Cliptut.


          Happy Clip'n!
          Jody

          All Lists: http://www.fookes.us/maillist.htm
          Convert your eMail programs... Aid4Mail: http://www.fookes/aid4mail
          Freeware and Shareware; seamleesly integrates with NoteTab:
          http://www.sojourner.us/software
          See ya in the funnies!-) http://www.clean-funnies.com
        Your message has been successfully submitted and would be delivered to recipients shortly.