Reformat MAC Address with Replace/Regular Expressions

Reformat MAC Address with Replace/Regular Expressions

2
NewbieNewbie
2

    Feb 24, 2005#1

    I am trying to reformat MAC addresses from the output of another file. The current format is nn-nn-nn-nn-nn-nn and I would like the output to be nnnn.nnnn.nnnn. In this case n is 0-9 or a-f. An example may help.
    OLD Format _______ New Format
    00-02-e3-08-f7-d2 0002.e308.f7d2
    00-0a-5e-45-98-f2 000a.5e45.98f2
    00-02-e3-06-87-44 0002.e306.8744

    Thank You Very Much in Advance. I do appreciate it!

    ~Davis
    Don't get stuck on "it should work".
    Look for what works well.

    206
    MasterMaster
    206

      Feb 25, 2005#2

      Find What: ([0-9,a-z][0-9,a-z])-([0-9,a-z][0-9,a-z])-([0-9,a-z][0-9,a-z])-([0-9,a-z][0-9,a-z])-([0-9,a-z][0-9,a-z])-([0-9,a-z][0-9,a-z])

      Replace With: \1\2.\3\4.\5\6


      Regular Expressions must be checked in the Replace dialog

      Unix style regular expressions checked
      main menu Advanced > Configuration > Find
      Software For Metalworking
      http://closetolerancesoftware.com

      2
      NewbieNewbie
      2

        Feb 25, 2005#3

        Awesome, And I mean You!! :D

        Thank You Very Much! I had started along the right path but would have never figured out the menu settings. Another mistake I made was that I was using [1-9a-z][1-9a-z]- for the search string. (No wonder it didn't work. But I tried many variations before I posted)

        Your answer says tons and will act as a guide for other challenges where I anticipate the need to do replaces.

        Thank You Very Much!!!!

        8
        NewbieNewbie
        8

          Mar 01, 2005#4

          mrainey56 wrote:Find What: ([0-9,a-z][0-9,a-z])-([0-9,a-z][0-9,a-z])-([0-9,a-z][0-9,a-z])-([0-9,a-z][0-9,a-z])-([0-9,a-z][0-9,a-z])-([0-9,a-z][0-9,a-z])

          Replace With: \1\2.\3\4.\5\6
          I'm looking at UltraEdit's help, and from reading it it looks to me like what you have above, "[0-9,a-z]" would not only match more than he was asking for, but would also match a comma. I see no mention of having to separate ranges by commas.

          Is this an indication of how poor UltraEdit's help is when it comes to documenting the Unix style regular expressions it supports, or is it me?

          I was also trying to find out if UltraEdit supported the unix-style non-greedy syntax of "*?", but could find nothing on it. Not even on a search of this forum.

          206
          MasterMaster
          206

            Mar 01, 2005#5

            You're correct, comma not needed. Don't know where I picked that up.
            Software For Metalworking
            http://closetolerancesoftware.com