The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Using Mailx to send to list of email addresses aguad3 UNIX Desktop for Dummies Questions & Answers 1 03-28-2008 03:40 PM
memory addresses Paravozzz High Level Programming 0 10-15-2002 01:17 PM
Extracting String from a list odogbolu98 Shell Programming and Scripting 4 06-01-2002 03:48 AM
Ip Addresses evil_d00d IP Networking 4 02-27-2002 03:32 AM
ip addresses dragonslayer100 IP Networking 2 01-28-2002 08:25 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-24-2008
dhs23 dhs23 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 7
Help extracting MAC addresses from List

Hello all.

I have a large number of text files outputted from various Netstumbler Wireless Scans; from which I need to extract the MAC addresses of the various Access Points.

The Text files look like this:


Code:
# $Creator: Network Stumbler Version 0.4.0
# $Format: wi-scan summary with extensions
# Latitude	Longitude	( SSID )	Type	( BSSID )	Time (GMT)	[ SNR Sig Noise ]	# ( Name )	Flags	Channelbits	BcnIntvl	DataRate	LastChannel
# $DateGMT: 2008-01-16
N 0.0000000	E 0.0000000	( belkin54g )	BSS	( 00:11:50:d7:c7:3c )	16:44:39 (GMT)	[ 19 68 49 ]	# (  )	0411	00000800	100	540	11
N 0.0000000	E 0.0000000	( BUFVC Wireless )	BSS	( 00:03:93:ec:21:93 )	16:44:39 (GMT)	[ 33 82 49 ]	# (  )	0411	00000080	100	540	7
N 0.0000000	E 0.0000000	( F-Wireless Zone )	BSS	( 00:19:e8:d8:c2:e0 )	16:44:39 (GMT)	[ 24 73 49 ]	# (  )	0421	00002000	100	540	13

What I would like to do is extract the MAC addresses into another text file so that it ends up looking like this:

FINAL TEXT FILE

Code:
00.11.50.d7.c7.3c
00.03.93.ec.21.93
00.19.e8.d8.c2.e0

I'm pretty new at this whole scripting thing, but I've managed to work our a couple of steps of this process.

1) I can use grep 'N 0.0' to get just the lines with MAC addresses

2) I can probably use tr -d to delete the () around the MAC addresses

What I'm failing to be able to do is basically everything else

1) how do I get just the MAC addresses out of that long line?
2) how do I swap the ":" separating the parts of the MAC addresses for "." ?

I realise this is probably fairly straight forward, and I've tried looking in the various man pages for the likes of awk, sed and grep, but to be honest they are a little confusing.

Any help getting my Wireless Scan text file to look like my hoped for Final text file would be greatly appreciated!

Cheers
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:29 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0