Delete characters & find unique IP addresses with port


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Delete characters & find unique IP addresses with port
# 1  
Old 03-09-2013
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
# 2  
Old 03-09-2013
Try:
Code:
awk -F@ '!A[$0=$2]++' file

This User Gave Thanks to Scrutinizer For This Post:
# 3  
Old 03-09-2013
Quote:
Originally Posted by Scrutinizer
Try:
Code:
awk -F@ '!A[$0=$2]++' file

Thanks, It worked.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

find & Replace text using two non-unique delimiters.

I can find and replace text when the delimiters are unique. What I cannot do is replace text using two NON-unique delimiters: Ex., "This html code <text blah >contains <garbage blah blah >. All tags must go,<text > but some must be replaced with <garbage blah blah > without erasing other... (5 Replies)
Discussion started by: bedtime
5 Replies

2. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies

3. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

4. Red Hat

Need Script to ZIP/SAVE & then DELETE Log file & DELETE ZIPS older than 12 months

ENVIROMENT Linux: Fedora Core release 1 (Yarrow) iPlanet: iPlanet-WebServer-Enterprise/6.0SP1 Log Path: /usr/iplanet/servers/https-company/logs I have iPlanet log rotation enabled rotating files on a daily basis. The rotated logs are NOT compressed & are taking up too much space. I... (7 Replies)
Discussion started by: zachs
7 Replies

5. UNIX for Dummies Questions & Answers

find & remove characters in filenames

I have a group of files in different directories with characters such as " ? : in the file names. How do I find these files and remove these characters on mass? Thanks (19 Replies)
Discussion started by: barrydocks
19 Replies

6. Shell Programming and Scripting

Single/Multiple Line with Special characters - Find & Replace in Unix Script

Hi, I am creating a script to do a find and replace single/multiple lines in a file with any number of lines. I have written a logic in a script that reads a reference file say "findrep" and populates two variables $FIND and $REPLACE print $FIND gives Hi How r $u Rahul() Note:... (0 Replies)
Discussion started by: r_sarnayak
0 Replies

7. Shell Programming and Scripting

get part of file with unique & non-unique string

I have an archive file that holds a batch of statements. I would like to be able to extract a certain statement based on the unique customer # (ie. 123456). The end for each statement is noted by "ENDSTM". I can find the line number for the beginning of the statement section with sed. ... (5 Replies)
Discussion started by: andrewsc
5 Replies

8. IP Networking

How can I check what port addresses used the application

Hello Mentors! I am a new here in the furom, i hope somebody can understand my problem. Basically we have an application here called unigraphics and being installed per station and the setup is look like this. 1. installed unigraphics UGNX3 version on every station 2. some are installed in... (1 Reply)
Discussion started by: eykyn17
1 Replies

9. UNIX for Dummies Questions & Answers

How to delete old email addresses?

Help! Need to delete old email addresses from address book on Dell Windows 98............. -------- The subject line was one long string - I inserted spaces - oombera (1 Reply)
Discussion started by: Deede
1 Replies

10. Programming

How to delete email addresses

I need to delete old email addresses and can't them them out of my address I have a dell and am served by MSN? (Email address removed... Neo) (4 Replies)
Discussion started by: Deede
4 Replies
Login or Register to Ask a Question