Overclockers Australia Forums

OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Software Topics > Programming & Software Development

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 2nd February 2010, 4:20 PM   #1
Myst Thread Starter
Member
 
Join Date: Feb 2004
Location: Hobart, Tasmania
Posts: 1,173
Default Change format of list of mac addresses?

Hi guys

I have a list of 250 mac addresses in the format:

00:1A:4B:C1:46:72

I need to run something over this and turn them into this format:

001A.4BC1.4672

This will enable easier cross-referencing with some previous results I have.

Can anyone recommend an easy way to achieve this?
Myst is offline   Reply With Quote

Join OCAU to remove this ad!
Old 2nd February 2010, 4:25 PM   #2
Taceo Corpus
Member
 
Taceo Corpus's Avatar
 
Join Date: Sep 2005
Location: Ho Chi Minh City, Vietnam
Posts: 3,247
Default

Assuming they're in a text file, you can use find and replace to get rid of the colons, and then make a macro in something like notepad++ which is just ". downarrow" and select the appropriate point in the first line and run it until the end of the file.

Just tried it then and it worked fine.
Taceo Corpus is offline   Reply With Quote
Old 2nd February 2010, 7:41 PM   #3
zzzzz
Member
 
zzzzz's Avatar
 
Join Date: Dec 2001
Location: Sydney, Australia.
Posts: 1,820
Default

If you have Excel handy:
Cell A1 your original MAC
Cell B1 =SUBSTITUTE(A1,":","")
Cell C1 =MID(B1,1,4)&":"&MID(B1,5,4)&":"&MID(B1,9,4)

Put original MACs into column A, 1 per cell
Fill down column B and C
__________________
zzzzz private message
zzzzz is offline   Reply With Quote
Old 2nd February 2010, 7:49 PM   #4
dalek
Member
 
Join Date: Jun 2001
Location: Wollongong
Posts: 46
Default

awk -F':' '{print $1 $2 "." $3 $4 "." $5 $6}' inputfile.txt
dalek is offline   Reply With Quote
Old 3rd February 2010, 5:44 PM   #5
Myst Thread Starter
Member
 
Join Date: Feb 2004
Location: Hobart, Tasmania
Posts: 1,173
Default

Thanks guys all fantastic suggestions!

Ended up using excel, worked a charm.
Myst is offline   Reply With Quote
Reply

Bookmarks

Sign up for a free OCAU account and this ad will go away!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 6:48 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Micron21!