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

Erasing to end of line

Expand Messages
  • Lee Underwood
    I am not sure if this has been answered before ... I couldn t find anything in the archives for this one. I have the following (several thousand lines,
    Message 1 of 5 , May 7, 2005
    • 0 Attachment
      I am not sure if this has been answered before ... I couldn't find anything
      in the archives for this one.

      I have the following (several thousand lines, actually), and I need to
      remove everything after the second colon, i.e.,

      Gen 1:1: In the beginning God created the heavens and the earth.
      Gen 1:2: The earth was formless and void, and darkness was over the surface
      of the deep, and the Spirit of God was moving over the surface of the waters.
      Gen 1:3: Then God said {"the Word of God"}, "Let there be light"; and there
      was light.

      needs to look like:

      Gen 1:1:
      Gen 1:2:
      Gen 1:3:

      Thanks,
      Lee
    • John Zeman
      ... I would use a regular expression to do this. e.g. ^!Replace ^{.*[0-9+]:[0-9+]:}{.*} 1 WARTS John
      Message 2 of 5 , May 7, 2005
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, Lee Underwood <leeu@c...> wrote:
        > I am not sure if this has been answered before ... I couldn't find anything
        > in the archives for this one.
        >
        > I have the following (several thousand lines, actually), and I need to
        > remove everything after the second colon, i.e.,
        >
        > Gen 1:1: In the beginning God created the heavens and the earth.
        > Gen 1:2: The earth was formless and void, and darkness was over the surface
        > of the deep, and the Spirit of God was moving over the surface of the waters.
        > Gen 1:3: Then God said {"the Word of God"}, "Let there be light"; and there
        > was light.
        >
        > needs to look like:
        >
        > Gen 1:1:
        > Gen 1:2:
        > Gen 1:3:
        >
        > Thanks,
        > Lee


        I would use a regular expression to do this. e.g.

        ^!Replace "^{.*[0-9+]:[0-9+]:}{.*}" >> "\1" WARTS

        John
      • Lee Underwood
        Thanks, but I m not sure if it works because, after running for a minute or so, it gives me an Out of Memory error. Any other suggestions? Lee On 5/7/05
        Message 3 of 5 , May 7, 2005
        • 0 Attachment
          Thanks, but I'm not sure if it works because, after running for a minute or
          so, it gives me an "Out of Memory" error. Any other suggestions?

          Lee


          On 5/7/05 02:54 PM, John Zeman wrote:
          ........................................................


          >I would use a regular expression to do this. e.g.
          >
          >^!Replace "^{.*[0-9+]:[0-9+]:}{.*}" >> "\1" WARTS
          >
          >John
          ........................................................
        • Lee Underwood
          Actually, I figured out how to do it. ......................... ^!ClearVariables ... ^!Find : ^!IfError EXIT ^!Keyboard RIGHT ^!Keyboard LEFT ^!Select EOL
          Message 4 of 5 , May 7, 2005
          • 0 Attachment
            Actually, I figured out how to do it.


            .........................
            ^!ClearVariables

            :AGAIN
            ^!Find ": "
            ^!IfError EXIT
            ^!Keyboard RIGHT
            ^!Keyboard LEFT
            ^!Select EOL
            ^!Keyboard DELETE
            ;^!Goto ^?{Do you want to go again?==_Yes^=AGAIN|No^=EXIT}
            ^!Goto AGAIN
            ...........................

            Not too sophisticated, probably a little too complex, but it did the job.
            Thanks anyway.

            Lee



            ........................................................

            >On 5/7/05 02:54 PM, John Zeman wrote:
            >........................................................
            >
            >
            > >I would use a regular expression to do this. e.g.
            > >
            > >^!Replace "^{.*[0-9+]:[0-9+]:}{.*}" >> "\1" WARTS
            > >
            > >John
            >........................................................
            >
            >
            >
            >Fookes Software: http://www.fookes.us, http://www.fookes.com
            >Fookes Software Mailing Lists: http://www.fookes.us/maillist.htm
            >
            >Yahoo! Groups Links
            >
            >
            >
            >
            ........................................................
          • acummingsus
            ... ^!Find : ^!IfError EXIT ^!Select EOL ^!Replace ^$GetSelection$ : IS ;^!Goto ^?{Do you want to go again?==_Yes^=AGAIN|No^=EXIT} ^!Goto AGAIN ;
            Message 5 of 5 , May 7, 2005
            • 0 Attachment
              --- In ntb-clips@yahoogroups.com, Lee Underwood <leeu@c...> wrote:
              > Actually, I figured out how to do it.
              >
              >
              > .........................
              > ^!ClearVariables
              >
              > :AGAIN
              > ^!Find ": "
              > ^!IfError EXIT
              > ^!Keyboard RIGHT
              > ^!Keyboard LEFT
              > ^!Select EOL
              > ^!Keyboard DELETE
              > ;^!Goto ^?{Do you want to go again?==_Yes^=AGAIN|No^=EXIT}
              > ^!Goto AGAIN
              > ...........................

              :AGAIN
              ^!Find ": "
              ^!IfError EXIT
              ^!Select EOL
              ^!Replace "^$GetSelection$" >> ":" IS
              ;^!Goto ^?{Do you want to go again?==_Yes^=AGAIN|No^=EXIT}
              ^!Goto AGAIN
              ; -----------------------------

              You said your file is large. I didn't test that. It may also work.
              If one is faster over the other, this I don't know.

              Just a tinkering. Nothing more.

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