Tutorial :How do I remove colons from a list of MAC addresses?


I'm having a hard time trying to remove the colons in a list of MAC addresses.

My file:

00:21:5A:28:62:BF  00:24:81:0A:04:44  

Expected Output:

00215A2862BF  0024810A0444  

Any ideas on how could I do this? Thanks a lot in advance.


Given your tags, you want to accomplish this in a shell:

cat file | sed s/://g  

edit: you don't really need the cat either if you are reading from a file:

sed s/://g file  


perl -pe "s/://g" yourfile  


echo "00:21:5A:28:62:BF" | sed -e 's/://g'  00215A2862BF  


tr -d ':' < file

will probably work too, though I don't have a command line handy to check the syntax.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »