|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Delete characters & find unique IP addresses with port
Hi, I have a file having following content. Code:
<sip:9376507346@97.208.31.7:51088 <sip:9907472291@97.208.31.7:51208 <sip:8103742422@97.208.31.7:51024 <sip:9579892841@97.208.31.7:51080 <sip:9370904222@97.208.31.7:51104 <sip:9327665215@97.208.31.7:51104 <sip:9098364262@97.208.31.7:51024 <sip:9373282166@97.208.31.7:51080 <sip:9098711378@97.208.31.7:51208 <sip:9579892841@97.208.31.7:51080 <sip:9907472291@97.208.31.7:51024 <sip:7803832998@97.208.31.7:51024 <sip:7498816129@97.208.31.7:51080 I want to delete all characters before "@" & then find out the unique IP addresses with port. Please help me to know how I can do this. Thanks, Sunil |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Try: Code:
awk -F@ '!A[$0=$2]++' file |
| The Following User Says Thank You to Scrutinizer For This Useful Post: | ||
SunilB2011 (03-09-2013) | ||
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Script to ZIP/SAVE & then DELETE Log file & DELETE ZIPS older than 12 months | zachs | Red Hat | 7 | 12-14-2012 01:06 PM |
| find & remove characters in filenames | barrydocks | UNIX for Dummies Questions & Answers | 19 | 12-22-2011 04:05 AM |
| Single/Multiple Line with Special characters - Find & Replace in Unix Script | r_sarnayak | Shell Programming and Scripting | 0 | 06-02-2010 02:34 AM |
| get part of file with unique & non-unique string | andrewsc | Shell Programming and Scripting | 5 | 09-17-2009 03:43 PM |
| How can I check what port addresses used the application | eykyn17 | IP Networking | 1 | 02-16-2006 11:58 AM |
|
|