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

Newbie help with clips... THANKS IN ADVANCE

Expand Messages
  • mygroups77054
    1. Say I have several lines like this: March 6, 2014, 9:49 PM March 6, 2014, 7:49 AM March 6, 2014, 8:49 PM 2. I want a search and replace command only to
    Message 1 of 4 , Mar 6, 2014
    • 0 Attachment
      1. Say I have several lines like this:

      March 6, 2014, 9:49 PM
      March 6, 2014, 7:49 AM
      March 6, 2014, 8:49 PM

      2. I want a search and replace command only to work on the "PM" lines. How would I do that? Say the command is to remove the commas.

      3. I want to put each element (for example the first one) in individual variables:

      month = variable "mo"
      day = variable "da"
      year = variable "yr"
      hour = variable "hr"
      minute = variable "mn"

      Note that REGEX is acceptable. I'm just not familiar enough with it.

      4. Finally, how would I loop through the active document, place each line into a variable, then after I do something with it, place it back into the same location.

      Thanks in advance.
    • Axel Berger
      ... Search for PM$ ... Get rid of commata, replace colon by space and ^!SetListDelimiter or ^!SetListDelimiter ^%SPACE% ^!SetArray
      Message 2 of 4 , Mar 6, 2014
      • 0 Attachment
        mygroups77054@... wrote:
        > 2. I want a search and replace command only to work on the "PM" lines.

        Search for "<other stuff>PM$"

        > each element (for example the first one) in individual variables:
        > month = variable "mo"

        Get rid of commata, replace colon by space and
        ^!SetListDelimiter " " or
        ^!SetListDelimiter ^%SPACE%
        ^!SetArray %some_name%=^$GetLine$
        ^!Set %mo%=^%some_name1%
        etc.

        > loop through the active document, place each line into a variable,
        > then after I do something with it, place it back into the same location.

        ^!Find
        ^!Select LINE
        <do something>
        ^!InsertText

        Note: InsertText is slow on big files, i.e. several hundred inserts.

        Axel
      • Robert Kelsey
        I use search/replace all the time in clips. I have found it to be incredibly helpful in assembling content into website pages. I m confronted with an issue
        Message 3 of 4 , Mar 8, 2014
        • 0 Attachment

          I use search/replace all the time in clips. I have found it to be incredibly helpful in assembling content into website pages.

           

          I’m confronted with an issue that I thought I had a clip for, but I don’t … and the repository online is still not moved …

           

          I have an export file from a WordPress blog that is like this:

           

          &gt;menustyle&lt;whatever the content is for this field and then the close&gt;/menustyle&lt;

           

          What I want to do is to remove both of the code’s, the start menustyle, and the end menustyle plus everything between them.

           

          I’m not a wizard with this stuff and can’t figure this out.

           

          --Robert

        • Robert Bull
          On Thursday, March 6, 2014, 3:26:31 PM, mygroups77054@yahoo.com wrote: myc Note that REGEX is acceptable. I m just not familiar enough with myc it. If you d
          Message 4 of 4 , Mar 9, 2014
          • 0 Attachment
            On Thursday, March 6, 2014, 3:26:31 PM, mygroups77054@... wrote:

            myc> Note that REGEX is acceptable. I'm just not familiar enough with
            myc> it.

            If you'd like to learn more, I recommend The AWK Programming Language,
            by Aho, Kernighan and Weinberger. The part that deals with regular
            expressions is very useful in itself, and probably a better way to
            start than wading into a whole book about nothing else. Also, if you
            get interested, AWK is one of the scripting languages that NoteTab
            understands. I have a number of clips that combine AWK scripts with
            native NoteTab functions.

            --
            Regards,

            Robert Bull
            mailto:barlennan@...
          Your message has been successfully submitted and would be delivered to recipients shortly.