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

regex ...

Expand Messages
  • Don - HtmlFixIt.com
    how to turn this 87 228 26 Matthew Murphy Whitehall 21:01.05 5:17.80 88 115 92 Lucas Timmer Holland Christian 21:06.94 5:23.69 into this
    Message 1 of 5 , Aug 30, 2009
    • 0 Attachment
      how to turn this
      87 228 26 Matthew Murphy Whitehall 21:01.05 5:17.80
      88 115 92 Lucas Timmer Holland Christian 21:06.94 5:23.69

      into this
      87[tab]228[tab]26[tab]Matthew[tab]Murphy[tab]Whitehall[tab]21:01.05[tab]5:17.80
      88[tab]115 92[tab]Lucas[tab]Timmer[tab]Holland
      Christian[tab]21:06.94[tab]5:23.69

      The problem is the school name may have one, two, three or more spaces
      in it.
    • John Shotsky
      I think you may have a typo in your after example, but it seems to me a simple find and replace will do what you want. If you want to replace each single or
      Message 2 of 5 , Aug 30, 2009
      • 0 Attachment
        I think you may have a typo in your after example, but it seems to me a simple find and replace will do what you want.
        If you want to replace each single or group of spaces with one tab, the following should do it.

        ^!Replace "\x20+" >> "\t" ARTSW
        John

        From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Don - HtmlFixIt.com
        Sent: Sunday, August 30, 2009 14:38
        To: ntb-clips@yahoogroups.com
        Subject: [Clip] regex ...


        how to turn this
        87 228 26 Matthew Murphy Whitehall 21:01.05 5:17.80
        88 115 92 Lucas Timmer Holland Christian 21:06.94 5:23.69

        into this
        87[tab]228[tab]26[tab]Matthew[tab]Murphy[tab]Whitehall[tab]21:01.05[tab]5:17.80
        88[tab]115 92[tab]Lucas[tab]Timmer[tab]Holland
        Christian[tab]21:06.94[tab]5:23.69

        The problem is the school name may have one, two, three or more spaces
        in it.



        [Non-text portions of this message have been removed]
      • Don - HtmlFixIt.com
        I don t, the school name has a space or more optional that isn t a tab. I also found some times the third number is there (like the 26 in the example) and
        Message 3 of 5 , Aug 30, 2009
        • 0 Attachment
          I don't, the school name has a space or more optional that isn't a tab.
          I also found some times the third number is there (like the 26 in the
          example) and sometimes that number is missing.

          I think this might be working ... pretty close ...

          ^(\d+) (\d+) (\d* *)([^ .]*) ([^ .]*) (.*) (\d.*) (\d.*)

          replace with

          $1\t$4\t$5\t$6\t$7

          John Shotsky wrote:
          > I think you may have a typo in your after example, but it seems to me a simple find and replace will do what you want.
          > If you want to replace each single or group of spaces with one tab, the following should do it.
          >
          > ^!Replace "\x20+" >> "\t" ARTSW
          > John
          >
          > From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Don - HtmlFixIt.com
          > Sent: Sunday, August 30, 2009 14:38
          > To: ntb-clips@yahoogroups.com
          > Subject: [Clip] regex ...
          >
          >
          > how to turn this
          > 87 228 26 Matthew Murphy Whitehall 21:01.05 5:17.80
          > 88 115 92 Lucas Timmer Holland Christian 21:06.94 5:23.69
          >
          > into this
          > 87[tab]228[tab]26[tab]Matthew[tab]Murphy[tab]Whitehall[tab]21:01.05[tab]5:17.80
          > 88[tab]115 92[tab]Lucas[tab]Timmer[tab]Holland
          > Christian[tab]21:06.94[tab]5:23.69
          >
          > The problem is the school name may have one, two, three or more spaces
          > in it.
          >
          >
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >
          > ------------------------------------
          >
          > Fookes Software: http://www.fookes.com/
          > NoteTab website: http://www.notetab.com/
          > NoteTab Discussion Lists: http://www.notetab.com/groups.php
          >
          > ***
          > Yahoo! Groups Links
          >
          >
          >
          >
        • John Shotsky
          I guess I don t understand the problem and/or desired solution. The result of running the clip I provided is:
          Message 4 of 5 , Aug 30, 2009
          • 0 Attachment
            I guess I don't understand the problem and/or desired solution.

            The result of running the clip I provided is:

            87[tab]228[tab]26[tab]Matthew[tab]Murphy[tab]Whitehall[tab]21:01.05[tab]5:17.80
            88[tab]115[tab]92[tab]Lucas[tab]Timmer[tab]Holland[tab]Christian[tab]21:06.94[tab]5:23.69

            Are you saying that the school name may have one or more words, and that no tab is wanted between them when there are
            multiple words in the school name?
            What about if there are 3 words in the name? (either middle name, middle initial, or suffix like Sr. Jr, etc?
            John

            From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Don - HtmlFixIt.com
            Sent: Sunday, August 30, 2009 15:03
            To: ntb-clips@yahoogroups.com
            Subject: Re: [Clip] regex ...


            I don't, the school name has a space or more optional that isn't a tab.
            I also found some times the third number is there (like the 26 in the
            example) and sometimes that number is missing.

            I think this might be working ... pretty close ...

            ^(\d+) (\d+) (\d* *)([^ .]*) ([^ .]*) (.*) (\d.*) (\d.*)

            replace with

            $1\t$4\t$5\t$6\t$7

            John Shotsky wrote:
            > I think you may have a typo in your after example, but it seems to me a simple find and replace will do what you want.
            > If you want to replace each single or group of spaces with one tab, the following should do it.
            >
            > ^!Replace "\x20+" >> "\t" ARTSW
            > John
            >
            > From: ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> [mailto:ntb-clips@yahoogroups.com
            <mailto:ntb-clips%40yahoogroups.com> ] On Behalf Of Don - HtmlFixIt.com
            > Sent: Sunday, August 30, 2009 14:38
            > To: ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com>
            > Subject: [Clip] regex ...
            >
            >
            > how to turn this
            > 87 228 26 Matthew Murphy Whitehall 21:01.05 5:17.80
            > 88 115 92 Lucas Timmer Holland Christian 21:06.94 5:23.69
            >
            > into this
            > 87[tab]228[tab]26[tab]Matthew[tab]Murphy[tab]Whitehall[tab]21:01.05[tab]5:17.80
            > 88[tab]115 92[tab]Lucas[tab]Timmer[tab]Holland
            > Christian[tab]21:06.94[tab]5:23.69
            >
            > The problem is the school name may have one, two, three or more spaces
            > in it.
            >
            >
            >
            > [Non-text portions of this message have been removed]
            >
            >
            >
            > ------------------------------------
            >
            > Fookes Software: http://www.fookes.com/
            > NoteTab website: http://www.notetab.com/
            > NoteTab Discussion Lists: http://www.notetab.com/groups.php
            >
            > ***
            > Yahoo! Groups Links
            >
            >
            >
            >



            [Non-text portions of this message have been removed]
          • Don - HtmlFixIt.com
            Good question ... there is only one name in the file with more than two ... O Keefe for a last name ... so I deleted the space. Holland[tab]Christian Should
            Message 5 of 5 , Aug 30, 2009
            • 0 Attachment
              Good question ... there is only one name in the file with more than two
              ... O Keefe for a last name ... so I deleted the space.
              Holland[tab]Christian
              Should not have a tab in it. That was the point I was trying to solve.

              I would have had your result just replacing all spaces with tabs.

              Also the 26/92 field may or may not be in the file.

              I think my solution worked well enough, but I suspect a more elegant
              solution exists.

              John Shotsky wrote:
              > I guess I don't understand the problem and/or desired solution.
              >
              > The result of running the clip I provided is:
              >
              > 87[tab]228[tab]26[tab]Matthew[tab]Murphy[tab]Whitehall[tab]21:01.05[tab]5:17.80
              > 88[tab]115[tab]92[tab]Lucas[tab]Timmer[tab]Holland[tab]Christian[tab]21:06.94[tab]5:23.69
              >
              > Are you saying that the school name may have one or more words, and that no tab is wanted between them when there are
              > multiple words in the school name?
              > What about if there are 3 words in the name? (either middle name, middle initial, or suffix like Sr. Jr, etc?
              > John
            Your message has been successfully submitted and would be delivered to recipients shortly.