TechSpot

Mac Address Converter 0000000000

By tipstir
Jun 26, 2007
Topic Status:
Not open for further replies.
  1. 1. go from this: 0000000000 to this: 00-00-00-00-00-00

    or

    2. go from this: 0a0b0c0d0e0f0d to this: 0a-0b-0c-0d-0e-0f-0d

    got a lot of mac address to convert and it takes it time to do it well me...
    Excel can with a custom script can do step 1, but in step 2 it won't do anything.
     
  2. Nodsu

    Nodsu TS Rookie Posts: 9,431

    This sort of depends on the exact input, but if you have a real OS (not Windows) or you get the sed utility for Windows, you could run a single command like
    Code:
    < input.txt sed 's/\(..\)/\1-/g' | sed 's/-$//' > output.txt
    This specific magic chant assumes a text file with one MAC address per line.
     
  3. tipstir

    tipstir TS Ambassador Topic Starter Posts: 4,663   +86

    This program right for SED for Windows which we use here. http://www.gnu.org/software/sed/sed.html
    GNU sed I'll give this a shot and see what happens? Thanks for you help! :) All I could find was perl script for UNIX process...
     
  4. Nodsu

    Nodsu TS Rookie Posts: 9,431

    May need some tweaking if you run it under Windows.. The redirection (<>|) and escapes \ work differently in DOS/Windows command line.

    If all else fails, install Cygwin or MSYS and run sed from there :)
     
  5. tipstir

    tipstir TS Ambassador Topic Starter Posts: 4,663   +86

    I've posted this question here and gbpvr forum and the answer was to use the MID function in excel which would give me the results I needed. Took a few attempts but now it working correctly. Also out senior network engineer wanted to know if the MID function could work to show what he sees in the domain router for MAC address so it does work we just tested here.

    Thanks again Nodsu..

    See this link below above all the coding that was used..
    http://forums.gbpvr.com/showthread.php?p=204656#post204656
     
Topic Status:
Not open for further replies.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.